Move and hand off a termbase
A translation system, a SKOS tool and a docs migration each want the termbase in a different shape. Copying it by hand leaves two sets that drift apart.
A glossary kept in one construct is not stuck there. manni term reads a
term set from pages, from body constructs in six formats, and from manifests.
manni term write renders the same set into another shape, or into an
interchange format a translation system imports. This page moves a DocBook
glossary to one Markdown page per term and back. Then it hands the set off as
TBX and CSV, and reads the translated termbase back.
Every transcript below is real output from the built tool.
What each construct holds
Section titled “What each construct holds”A construct is read for what it can say, and no further. A definition list has nowhere to put a scope note, so no scope note is read from one.
| Construct | Needs type: term-set | Reads |
|---|---|---|
Page metadata, type: term, in any format | n/a | every field |
YAML or JSON manifest under term.manifests | n/a | every field |
TBX v2 or v3 entry, in a .tbx file | no | every field except abstract, broader, narrower, related-terms, see and scope-note, a term per language |
MadCap Flare GlossaryEntry, in a .flglo file | no | label, definition, alt-labels, id |
SKOS concept, in a .ttl or .jsonld file you name or list | no | label, definition, alt-labels, hidden-labels, broader, narrower, related-terms, scope-note, notation, the five match fields, notes, contexts, a term per language |
DITA <glossentry> topic | no | label, definition, alt-labels, scope-note, id |
DITA <glossgroup> | no | the same, per child <glossentry> |
DocBook <glossary> | no | label, definition, alt-labels, see, related-terms, id |
HTML <dl> | yes | label, definition, alt-labels, id |
HTML <dfn> | yes | label, alt-labels, id |
| Markdown or MDX definition list | yes | label, definition, alt-labels |
AsciiDoc [glossary] list | no | label, definition, alt-labels |
reStructuredText .. glossary:: | no | label, definition, alt-labels |
Where a construct allows several terms against one definition, the first is
the label and the rest are alt-labels. That covers several <dt> before one
<dd>, several terms in one .. glossary:: entry, and a DocBook <glossterm>
beside an <acronym>.
DITA’s element names are the only ones that differ from the record’s:
| DITA | Field |
|---|---|
<glossterm> | label |
<glossdef> | definition |
<glossAlt><glossSynonym> | alt-labels |
<glossAlt><glossAcronym> | alt-labels |
<glossBody><glossUsage> | scope-note |
topic @id | id |
manni term formats prints what the build reads and writes, per format. The
CLI reference shows its output.
Move a DocBook glossary to pages
Section titled “Move a DocBook glossary to pages”The starting point is one DocBook file holding three entries. varifocal is a
redirect to progressive-lens:
<?xml version="1.0" encoding="UTF-8"?><article xmlns="http://docbook.org/ns/docbook" version="5.0"> <title>Optics</title> <glossary> <title>Glossary</title> <glossentry xml:id="bifocal"> <glossterm>bifocal</glossterm> <glossdef> <para>Lenses with two distinct optical powers, divided by a visible line.</para> </glossdef> </glossentry> <glossentry xml:id="progressive-lens"> <glossterm>progressive lens</glossterm> <acronym>PAL</acronym> <glossdef> <para>Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.</para> <glossseealso otherterm="bifocal"/> </glossdef> </glossentry> <glossentry xml:id="varifocal"> <glossterm>varifocal</glossterm> <glosssee otherterm="progressive-lens"/> </glossentry> </glossary></article>-
See what is read.
Terminal window manni term list docs/glossary.xmlbifocal bifocalprogressive-lens progressive lens PALvarifocal varifocal3 terms -
Render one page per term. The trailing
/makes-oa directory, so each entry gets a file named after its id:Terminal window manni term write docs/glossary.xml -f markdown -o docs/terms/Wrote 3 terms to docs/terms/, one file eachdocs/terms/progressive-lens.md ---title: progressive lenstype: termid: progressive-lenslabel: progressive lensdefinition: Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.alt-labels:- PALrelated-terms:- bifocal---A page holds every field, so nothing was dropped.
<glossseealso>becamerelated-terms, and<glosssee>becameseeonvarifocal. -
Grow the pages. A page can now carry what DocBook could not. This one gains a language, an abstract, a hidden-label and a scope note:
docs/terms/progressive-lens.md ---title: progressive lenstype: termid: progressive-lenslanguage: enlabel: progressive lensdefinition: Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.abstract: Lenses that correct presbyopia without a visible line.alt-labels:- PALhidden-labels:- no-line bifocalrelated-terms:- bifocalscope-note: Spectacle lenses only. Contact lenses are out of scope.---
Render back into one file
Section titled “Render back into one file”A path without a trailing /, naming no existing directory, gets every entry
in one file. The format’s list construct cannot hold every field, and the
report says what was dropped:
manni term write docs/terms/ -f docbook -o build/glossary.xmlWrote 3 terms to build/glossary.xml dropped from a DocBook glossary: abstract on 1 term, hidden-labels on 1, scope-note on 1<?xml version="1.0" encoding="UTF-8"?><glossary xmlns="http://docbook.org/ns/docbook" version="5.0"> <title>Glossary</title> <glossentry xml:id="bifocal"> <glossterm>bifocal</glossterm> <glossdef> <para>Lenses with two distinct optical powers, divided by a visible line.</para> </glossdef> </glossentry> <glossentry xml:id="progressive-lens"> <glossterm>progressive lens</glossterm> <acronym>PAL</acronym> <glossdef> <para>Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.</para> <glossseealso>bifocal</glossseealso> </glossdef> </glossentry> <glossentry xml:id="varifocal"> <glossterm>varifocal</glossterm> <glosssee>progressive-lens</glosssee> </glossentry></glossary>A Markdown definition list holds less again. It keeps the label, the definition and the alt-labels:
manni term write docs/terms/ -f markdown -o glossary.mdWrote 2 terms to glossary.md dropped from a definition list: abstract on 1 term, hidden-labels on 1, related-terms on 1, scope-note on 1 skipped 1 term a definition list cannot read without a definition: varifocal---type: term-set---
bifocal: Lenses with two distinct optical powers, divided by a visible line.
progressive lensPAL: Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.--dry-run prints the files a render would create or change, then the same
dropped and skipped lines a write prints, and writes nothing:
$ manni term write docs/terms/ -f markdown -o glossary.md --dry-runglossary.md would be created dropped from a definition list: abstract on 1 term, hidden-labels on 1, related-terms on 1, scope-note on 1 skipped 1 term a definition list cannot read without a definition: varifocal--check prints only the files, and exits 1 when one differs. When none
does, it prints that the target is up to date.
What each render holds
Section titled “What each render holds”-f | -o a directory | -o a file | Holds |
|---|---|---|---|
markdown, mdx, asciidoc, rst | one term page per entry | a definition list, a [glossary] list, or a .. glossary:: | a page holds every field. A list holds label, definition and alt-labels |
html | one term page per entry, fields in <meta> | a <dl> | a page holds every field. A <dl> holds label, definition, alt-labels and id |
dita | one <glossentry> topic per entry | a <glossgroup> | label, definition, alt-labels, scope-note, id |
docbook | refused | a <glossary> | label, definition, alt-labels, see, related-terms, id |
tbx | refused | TBX v2 | every field except abstract, broader, narrower, related-terms, see, scope-note, notation and the five match fields |
tbx3 | refused | TBX v3 | the same as tbx |
skos | refused | a SKOS concept scheme in JSON-LD | the ten SKOS fields except abstract, plus notation, the five match fields, notes and contexts. A see entry is an alt-label of its target |
skos-ttl | refused | a SKOS concept scheme in Turtle | the same as skos |
csv | refused | one row per id | the ten SKOS fields, a column set per language |
json | refused | { "terms": [...] } | every field |
vale | the Terms style | n/a | see the generated style |
A directory target for a format that writes one file stops with exit 2:
manni: -f tbx writes one file, not a directory. Pass -o <file>.What a round trip does not keep
Section titled “What a round trip does not keep”A render writes the record, and a read of the result builds a record again. Three things do not survive that trip.
A line break inside a paragraph
Section titled “A line break inside a paragraph”This definition has a line break inside its first paragraph, and a paragraph break before its second:
$ manni term get "progressive lens" docs/terms -f json{ "id": "progressive-lens", "label": "progressive lens", "definition": "Corrective lenses whose power increases\nfrom the top of the lens to the bottom.\n\nThey correct presbyopia without a visible line."}A definition list writes the break, and reads it back as a space:
$ manni term write docs/terms -f markdown -o build/glossary.mdWrote 1 term to build/glossary.md$ manni term get "progressive lens" build/glossary.md -f json{ "id": "progressive-lens", "label": "progressive lens", "definition": "Corrective lenses whose power increases from the top of the lens to the bottom.\n\nThey correct presbyopia without a visible line."}The paragraph break survives. The same happens in every list construct. A
Markdown or MDX definition list, an AsciiDoc [glossary] list and a
.. glossary:: read the break back as a space. An HTML <dl>, a DITA
<glossentry> or <glossgroup>, and a DocBook <glossary> write each
paragraph on one line:
<glossdef> <para>Corrective lenses whose power increases from the top of the lens to the bottom.</para> <para>They correct presbyopia without a visible line.</para></glossdef>A term page, in Markdown or HTML, keeps the break. So do TBX, SKOS, CSV and JSON, which write the definition as it is. Where a break matters, keep the definition in pages, or make it a paragraph break.
An id in a construct with no identifier
Section titled “An id in a construct with no identifier”A Markdown or MDX definition list, an AsciiDoc [glossary] list and a
.. glossary:: have nowhere to store an id. An entry read back from one gets
the slug of its label:
$ manni term list docs/termspal-lens progressive lens1 term$ manni term write docs/terms -f markdown -o build/glossary.mdWrote 1 term to build/glossary.md$ manni term list build/glossary.mdprogressive-lens progressive lens1 termThe run does not list id among the dropped fields. A page rendered from that
list is build/terms/progressive-lens.md, with id: progressive-lens. So an
id that is not the slug of its label changes, and so does the file named
after it.
Pages and manifests keep the id. So do an HTML <dl>, through <dt id>, a
DITA topic id, and a DocBook xml:id:
$ manni term write docs/terms -f html -o build/glossary.htmlWrote 1 term to build/glossary.html$ manni term list build/glossary.htmlpal-lens progressive lens1 termMarkup the record has no field for
Section titled “Markup the record has no field for”A render writes only the record’s fields. An attribute or element outside
them is not carried into the output, even when the source and the target are
the same format. This DocBook entry carries a role:
<glossentry xml:id="progressive-lens" role="clinical"> <glossterm>progressive lens</glossterm> <glossdef> <para>Corrective lenses whose power increases from the top of the lens to the bottom.</para> </glossdef></glossentry>Rendered to DocBook, the role is gone:
$ manni term write docs/glossary.xml -f docbook -o build/glossary.xmlWrote 1 term to build/glossary.xml$ cat build/glossary.xml<?xml version="1.0" encoding="UTF-8"?><glossary xmlns="http://docbook.org/ns/docbook" version="5.0"> <title>Glossary</title> <glossentry xml:id="progressive-lens"> <glossterm>progressive lens</glossterm> <glossdef> <para>Corrective lenses whose power increases from the top of the lens to the bottom.</para> </glossdef> </glossentry></glossary>The run reports no dropped field, because role is not a field. The same
goes for a DITA outputclass. The document around the glossary is not carried
either. The source’s <article> and its Optics title became a bare
<glossary> titled Glossary. A render is a new file, so keep the source
where that markup lives.
TBX is the exception. Its reader keeps an element no field names in
tbx-elements, and inline markup in tbx-markup, so a TBX render puts them
back. Read the termbase back shows what it keeps.
Hand the set to a translation system
Section titled “Hand the set to a translation system”-
Write TBX. TBX is the termbase exchange format translation systems import.
-f tbxwrites TBX v2, and-f tbx3writes TBX v3. The kind of label becomes each designation’s status:Terminal window manni term write docs/terms/ -f tbx -o build/terms.tbxWrote 3 terms to build/terms.tbxdropped from tbx: abstract on 1 term, related-terms on 1, see on 1, scope-note on 1build/terms.tbx <?xml version="1.0" encoding="UTF-8"?><martif type="TBX" xml:lang="en">...<termEntry id="progressive-lens"><langSet xml:lang="en"><descrip type="definition">Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.</descrip><tig><term>progressive lens</term><termNote type="administrativeStatus">preferredTerm-admn-sts</termNote></tig><tig><term>PAL</term><termNote type="administrativeStatus">admittedTerm-admn-sts</termNote></tig><tig><term>no-line bifocal</term><termNote type="administrativeStatus">deprecatedTerm-admn-sts</termNote></tig></langSet></termEntry>...</martif>Each language section takes its term’s
language, and the definition sits inside it. A term that declares none is written asen.-f tbx3writes the same entries as<conceptEntry>,<langSec>and<termSec>, under<tbx type="TBX-Basic" style="dca">. A set that carries a TBX-Linguist field, such asregisterortransfer-comments, is written asTBX-Linguist. -
Or write CSV. A spreadsheet or a system that maps columns by header gets one row per entry. The per-language columns carry the language in their header, and a list field joins its values with
|:Terminal window manni term write docs/terms/ -f csv -o build/terms.csvID,Term [en],Definition [en],Abstract [en],Alt labels [en],Hidden labels [en],Scope note [en],Broader,Narrower,Related terms,Seebifocal,bifocal,"Lenses with two distinct optical powers, divided by a visible line.",,,,,,,,progressive-lens,progressive lens,Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.,Lenses that correct presbyopia without a visible line.,PAL,no-line bifocal,Spectacle lenses only. Contact lenses are out of scope.,,,bifocal,varifocal,varifocal,,,,,,,,,progressive-lensCSV holds the ten SKOS fields. A TBX field, such as
designationsorconcept-entry, is reported dropped.
Read the termbase back
Section titled “Read the termbase back”The translation team returns the termbase with a German term for each concept, grammatical gender, and a vendor field. This one is TBX v3:
<?xml version="1.0" encoding="UTF-8"?><tbx type="TBX-Basic" style="dca" xml:lang="en" xmlns="urn:iso:std:iso:30042:ed-2"> <tbxHeader> <fileDesc> <sourceDesc> <p>Optics termbase, exported by the translation team.</p> </sourceDesc> </fileDesc> </tbxHeader> <text> <body> <conceptEntry id="progressive-lens"> <descrip type="subjectField">optics</descrip> <descrip type="Client">Acme</descrip> <langSec xml:lang="en"> <descrip type="definition">Corrective lenses whose power increases continuously.</descrip> <termSec> <term>progressive lens</term> <termNote type="administrativeStatus">preferredTerm-admn-sts</termNote> <termNote type="partOfSpeech">noun</termNote> <termNote type="termType">fullForm</termNote> </termSec> <termSec> <term>PAL</term> <termNote type="administrativeStatus">admittedTerm-admn-sts</termNote> <termNote type="termType">acronym</termNote> </termSec> <termSec> <term>no-line bifocal</term> <termNote type="administrativeStatus">supersededTerm-admn-sts</termNote> </termSec> </langSec> <langSec xml:lang="de"> <descrip type="definition">Brillenglas mit stufenlos zunehmender Wirkung.</descrip> <termSec> <term>Gleitsichtglas</term> <termNote type="administrativeStatus">preferredTerm-admn-sts</termNote> <termNote type="grammaticalGender">neuter</termNote> </termSec> <termSec> <term>Gleitsichtbrille</term> <termNote type="administrativeStatus">admittedTerm-admn-sts</termNote> <termNote type="grammaticalGender">feminine</termNote> </termSec> </langSec> </conceptEntry> <conceptEntry id="bifocal"> <langSec xml:lang="en"> <descrip type="definition">Lenses with two distinct optical powers, divided by a visible line.</descrip> <termSec> <term>bifocal</term> <termNote type="administrativeStatus">preferredTerm-admn-sts</termNote> </termSec> </langSec> <langSec xml:lang="de"> <descrip type="definition">Brillenglas mit zwei getrennten Wirkungen.</descrip> <termSec> <term>Bifokalglas</term> <termNote type="administrativeStatus">preferredTerm-admn-sts</termNote> </termSec> </langSec> </conceptEntry> </body> </text></tbx>-
See what is read. Each language of an entry is a term of its own, with the entry’s id. The list adds a language column when the set holds more than one:
Terminal window manni term list l10n/glossary.tbxprogressive-lens en progressive lens PALprogressive-lens de Gleitsichtglas Gleitsichtbrillebifocal en bifocalbifocal de Bifokalglas4 termsA walk of a directory reads a
.tbxfile it finds, andterm.manifestscan list one.-reads one from stdin with--as tbx. -
Look at one term. Every TBX data category has a named field. A value about the concept sits in
concept-entry, and a value about one designation in itsdesignationsitem:Terminal window manni term get PAL l10n/glossary.tbxprogressive lens l10n/glossary.tbx:15id progressive-lenslanguage enalt-labels PALhidden-labels no-line bifocaldefinition Corrective lenses whose power increases continuously.concept-entry subject-field: opticsdesignations progressive lens: part-of-speech noun, term-type fullFormPAL: term-type acronymno-line bifocal: administrative-status supersededtbx-elements 1 in concept-entryother languages de (Gleitsichtglas)The vendor’s
Clientfield has no name in TBX-Basic, so it rides along whole intbx-elements. The superseded term is a hidden-label that keeps its status. The terminology reference has every field. -
Write it back. In place, an unchanged termbase stays byte-identical. So does an export at the file’s own version:
Terminal window $ manni term write l10n/glossary.tbxNothing to write$ manni term write l10n/glossary.tbx -f tbx3 -o build/same.tbxWrote 4 terms to build/same.tbx$ cmp l10n/glossary.tbx build/same.tbx && echo identicalidentical-f tbxturns the v3 file into v2. The header carries over, and each entry is written in v2’s element names:Terminal window $ manni term write l10n/glossary.tbx -f tbx -o build/glossary-v2.tbxWrote 4 terms to build/glossary-v2.tbx -
Render the pages. A set in more than one language puts each page under a directory named for its language:
Terminal window manni term write l10n/glossary.tbx -f markdown -o docs/glossary/Wrote 4 terms to docs/glossary/, one file eachdropped from a page: the header of l10n/glossary.tbxdocs/glossary/de/progressive-lens.md ---title: Gleitsichtglastype: termid: progressive-lenslanguage: delabel: Gleitsichtglasdefinition: Brillenglas mit stufenlos zunehmender Wirkung.alt-labels:- Gleitsichtbrilleconcept-entry:subject-field: opticstbx-elements:- <descrip type="Client">Acme</descrip>designations:- term: Gleitsichtglasgrammatical-gender: neuter- term: Gleitsichtbrillegrammatical-gender: feminine---The pages hold every field. The file’s header is not a term, so it stays behind, and the run says so.
-
Hand the pages back as TBX. The pages join on id into one entry per concept:
Terminal window manni term write docs/glossary/ -f tbx3 -o build/glossary.tbxWrote 4 terms to build/glossary.tbxThe entries come in the order the pages are read, and the walk reads
de/beforeen/. The header is manni’s own. Where the languages disagree on the concept, the entry keeps the first one read and the run names the field. Here the German page sayssubject-field: Optik:Wrote 4 terms to build/glossary.tbxkept the first language's value where languages differ: concept-entry.subject-field on 1 concept
CSV joins the languages on id too, one row per concept, with each language’s columns side by side:
$ manni term write docs/glossary/ -f csv -o build/glossary.csvWrote 4 terms to build/glossary.csv dropped from csv: concept-entry on 2 terms, designations on 2$ cat build/glossary.csvID,Term [de],Definition [de],Abstract [de],Alt labels [de],Hidden labels [de],Scope note [de],Term [en],Definition [en],Abstract [en],Alt labels [en],Hidden labels [en],Scope note [en],Broader,Narrower,Related terms,Seebifocal,Bifokalglas,Brillenglas mit zwei getrennten Wirkungen.,,,,,bifocal,"Lenses with two distinct optical powers, divided by a visible line.",,,,,,,,progressive-lens,Gleitsichtglas,Brillenglas mit stufenlos zunehmender Wirkung.,,Gleitsichtbrille,,,progressive lens,Corrective lenses whose power increases continuously.,,PAL,no-line bifocal,,,,,A one-file document holds one language. A definition list, a <glossary> or a
<dl> writes the first term’s language, and names the terms it left out:
Wrote 2 terms to build/glossary.md dropped from a definition list: hidden-labels on 1 term, concept-entry on 1, designations on 1 dropped from a definition list: the header of l10n/glossary.tbx skipped 2 terms in another language than en: progressive-lens (de), bifocal (de)What a TBX round trip keeps
Section titled “What a TBX round trip keeps”A TBX file’s records survive any trip through manni. Read a termbase, write it
as tbx or tbx3, and read the result. Every field, designations,
tbx-elements, tbx-markup and language comes back equal.
The bytes survive at the file’s own version. An unchanged entry is copied as it was, and so is everything outside the entries. A file manni wrote exports byte-identical. A file another tool wrote exports equivalent XML, differing only in whitespace between elements, attribute order and quote style.
An entry whose record changed is written in manni’s layout. It keeps its
attributes, and an ntig stays an ntig. It loses what sat outside the
record:
- the order of its children, which takes manni’s order;
- a comment, a processing instruction or a CDATA section between its elements;
- a language section with no
<term>; - the layout of an
ntig’s children.
A DTD entity reference such as &acme; survives the rewrite. The element that
holds it rides whole in tbx-elements, and a <term> keeps it in
tbx-markup.
Exporting to the other version writes every entry in manni’s layout. It
carries the header and <back>, and drops the XML prolog. DCT style becomes
DCA, and an ntig becomes a tig or a termSec. Inline tags are not
converted between v2’s <bpt>/<ept> and v3’s <sc>/<ec>. abstract,
broader, narrower, related-terms, see and scope-note have no TBX-Basic
category, so a TBX render drops them and says so.
Only UTF-8 TBX is read.
Bring a SKOS scheme in
Section titled “Bring a SKOS scheme in”A taxonomy kept in a thesaurus editor leaves it as SKOS, in Turtle or JSON-LD. This one holds two concepts in English and German:
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .@prefix ex: <https://example.com/optics/> .
ex: a skos:ConceptScheme ; skos:hasTopConcept ex:spectacle-lens .
ex:spectacle-lens a skos:Concept ; skos:inScheme ex: ; skos:topConceptOf ex: ; skos:prefLabel "spectacle lens"@en, "Brillenglas"@de ; skos:definition "A lens worn in front of the eye to correct vision."@en ; skos:narrower ex:progressive-lens .
ex:progressive-lens a skos:Concept ; skos:inScheme ex: ; skos:prefLabel "progressive lens"@en, "Gleitsichtglas"@de ; skos:altLabel "PAL"@en ; skos:definition "Corrective lenses whose power increases continuously."@en, "Brillenglas mit stufenlos zunehmender Wirkung."@de ; skos:broader ex:spectacle-lens ; skos:notation "OPT-2" ; skos:closeMatch <http://www.wikidata.org/entity/Q1052424> ; skos:changeNote "Definition shortened."@en .-
See what is read. Each concept is a term per language its
skos:prefLabelholds, with the id its IRI ends in:Terminal window $ manni term list l10n/optics.ttlmanni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.progressive-lens de Gleitsichtglasprogressive-lens en progressive lens PALspectacle-lens de Brillenglasspectacle-lens en spectacle lens4 termsA property no term field holds is named once per file on stderr, and the exit code stays
0. A.ttlor.jsonldfile is read when you name it, or whenterm.manifestslists it. A directory walk never picks one up, becausemanni graph buildwrites Turtle too.-reads one from stdin with--as skos. -
Look at one term. A relation holds the id of the concept it points to, and a match holds the IRI as written:
Terminal window $ manni term get PAL l10n/optics.ttlmanni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.progressive lens l10n/optics.ttl:1id progressive-lenslanguage enalt-labels PALbroader spectacle-lensnotation OPT-2close-matches http://www.wikidata.org/entity/Q1052424definition Corrective lenses whose power increases continuously.other languages de (Gleitsichtglas) -
Render the pages. A SKOS file is not rewritten in place, so the set moves into pages with
-f:Terminal window $ manni term write l10n/optics.ttl -f markdown -o docs/glossary/manni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.Wrote 4 terms to docs/glossary/, one file eachdocs/glossary/de/progressive-lens.md ---title: Gleitsichtglastype: termid: progressive-lenslanguage: delabel: Gleitsichtglasdefinition: Brillenglas mit stufenlos zunehmender Wirkung.broader:- spectacle-lensnotation: OPT-2close-matches:- http://www.wikidata.org/entity/Q1052424---
manni term write l10n/optics.ttl with no -f stops with exit 2:
manni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.manni: l10n/optics.ttl is SKOS and is not rewritten in place; render it with -f skos or -f skos-ttl.Hand a SKOS scheme out
Section titled “Hand a SKOS scheme out”-f skos-ttl writes the set as a concept scheme in Turtle, and -f skos
writes the same scheme in JSON-LD. Each id is one concept, with every
language’s labels on it. A concept with no broader one is a top concept of the
scheme:
$ manni term write docs/glossary/ -f skos-ttl -o build/optics.ttlWrote 4 terms to build/optics.ttl$ cat build/optics.ttl@prefix skos: <http://www.w3.org/2004/02/skos/core#>.@prefix dcterms: <http://purl.org/dc/terms/>.
<> a skos:ConceptScheme; dcterms:description "Generated by manni term write."; skos:hasTopConcept <#spectacle-lens>.<#progressive-lens> a skos:Concept; skos:inScheme <>; skos:prefLabel "Gleitsichtglas"@de, "progressive lens"@en; skos:altLabel "PAL"@en; skos:definition "Brillenglas mit stufenlos zunehmender Wirkung."@de, "Corrective lenses whose power increases continuously."@en; skos:notation "OPT-2"; skos:broader <#spectacle-lens>; skos:closeMatch <http://www.wikidata.org/entity/Q1052424>.<#spectacle-lens> a skos:Concept; skos:inScheme <>; skos:topConceptOf <>; skos:prefLabel "Brillenglas"@de, "spectacle lens"@en; skos:definition "A lens worn in front of the eye to correct vision."@en; skos:narrower <#progressive-lens>.The concepts sit at #<id> in the document, so a tool that loads the file
resolves them against its URL. Every field SKOS holds comes back equal when
the file is read again. abstract has no SKOS property, so the render drops it
and says so.
Write back in place
Section titled “Write back in place”With no -f, manni term write sends each entry back through the reader that
read it. Only an entry whose record differs from its file is rewritten. A set
read and written unchanged leaves every file byte-identical:
$ manni term write docs/Nothing to writeA body construct is spliced in place, and a page is rewritten through the
extractor that read it. An HTML <dfn> is the one construct that cannot be
written back:
manni: glossary.html: a dfn cannot be written in place. Pass -f <format> -o <path>.