Skip to content

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.

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.

ConstructNeeds type: term-setReads
Page metadata, type: term, in any formatn/aevery field
YAML or JSON manifest under term.manifestsn/aevery field
TBX v2 or v3 entry, in a .tbx filenoevery field except abstract, broader, narrower, related-terms, see and scope-note, a term per language
MadCap Flare GlossaryEntry, in a .flglo filenolabel, definition, alt-labels, id
SKOS concept, in a .ttl or .jsonld file you name or listnolabel, definition, alt-labels, hidden-labels, broader, narrower, related-terms, scope-note, notation, the five match fields, notes, contexts, a term per language
DITA <glossentry> topicnolabel, definition, alt-labels, scope-note, id
DITA <glossgroup>nothe same, per child <glossentry>
DocBook <glossary>nolabel, definition, alt-labels, see, related-terms, id
HTML <dl>yeslabel, definition, alt-labels, id
HTML <dfn>yeslabel, alt-labels, id
Markdown or MDX definition listyeslabel, definition, alt-labels
AsciiDoc [glossary] listnolabel, definition, alt-labels
reStructuredText .. glossary::nolabel, 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:

DITAField
<glossterm>label
<glossdef>definition
<glossAlt><glossSynonym>alt-labels
<glossAlt><glossAcronym>alt-labels
<glossBody><glossUsage>scope-note
topic @idid

manni term formats prints what the build reads and writes, per format. The CLI reference shows its output.

The starting point is one DocBook file holding three entries. varifocal is a redirect to progressive-lens:

docs/glossary.xml
<?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>
  1. See what is read.

    Terminal window
    manni term list docs/glossary.xml
    bifocal bifocal
    progressive-lens progressive lens PAL
    varifocal varifocal
    3 terms
  2. Render one page per term. The trailing / makes -o a 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 each
    docs/terms/progressive-lens.md
    ---
    title: progressive lens
    type: term
    id: progressive-lens
    label: progressive lens
    definition: Corrective lenses whose optical power increases continuously from the top of the lens to the bottom.
    alt-labels:
    - PAL
    related-terms:
    - bifocal
    ---

    A page holds every field, so nothing was dropped. <glossseealso> became related-terms, and <glosssee> became see on varifocal.

  3. 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 lens
    type: term
    id: progressive-lens
    language: en
    label: progressive lens
    definition: 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:
    - PAL
    hidden-labels:
    - no-line bifocal
    related-terms:
    - bifocal
    scope-note: Spectacle lenses only. Contact lenses are out of scope.
    ---

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:

Terminal window
manni term write docs/terms/ -f docbook -o build/glossary.xml
Wrote 3 terms to build/glossary.xml
dropped from a DocBook glossary: abstract on 1 term, hidden-labels on 1, scope-note on 1
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="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:

Terminal window
manni term write docs/terms/ -f markdown -o glossary.md
Wrote 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
glossary.md
---
type: term-set
---
bifocal
: Lenses with two distinct optical powers, divided by a visible line.
progressive lens
PAL
: 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:

Terminal window
$ manni term write docs/terms/ -f markdown -o glossary.md --dry-run
glossary.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.

-f-o a directory-o a fileHolds
markdown, mdx, asciidoc, rstone term page per entrya definition list, a [glossary] list, or a .. glossary::a page holds every field. A list holds label, definition and alt-labels
htmlone term page per entry, fields in <meta>a <dl>a page holds every field. A <dl> holds label, definition, alt-labels and id
ditaone <glossentry> topic per entrya <glossgroup>label, definition, alt-labels, scope-note, id
docbookrefuseda <glossary>label, definition, alt-labels, see, related-terms, id
tbxrefusedTBX v2every field except abstract, broader, narrower, related-terms, see, scope-note, notation and the five match fields
tbx3refusedTBX v3the same as tbx
skosrefuseda SKOS concept scheme in JSON-LDthe 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-ttlrefuseda SKOS concept scheme in Turtlethe same as skos
csvrefusedone row per idthe ten SKOS fields, a column set per language
jsonrefused{ "terms": [...] }every field
valethe Terms stylen/asee 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>.

A render writes the record, and a read of the result builds a record again. Three things do not survive that trip.

This definition has a line break inside its first paragraph, and a paragraph break before its second:

Terminal window
$ 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:

Terminal window
$ manni term write docs/terms -f markdown -o build/glossary.md
Wrote 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:

build/glossary.xml
<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.

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:

Terminal window
$ manni term list docs/terms
pal-lens progressive lens
1 term
$ manni term write docs/terms -f markdown -o build/glossary.md
Wrote 1 term to build/glossary.md
$ manni term list build/glossary.md
progressive-lens progressive lens
1 term

The 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:

Terminal window
$ manni term write docs/terms -f html -o build/glossary.html
Wrote 1 term to build/glossary.html
$ manni term list build/glossary.html
pal-lens progressive lens
1 term

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:

docs/glossary.xml
<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:

Terminal window
$ manni term write docs/glossary.xml -f docbook -o build/glossary.xml
Wrote 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.

  1. Write TBX. TBX is the termbase exchange format translation systems import. -f tbx writes TBX v2, and -f tbx3 writes TBX v3. The kind of label becomes each designation’s status:

    Terminal window
    manni term write docs/terms/ -f tbx -o build/terms.tbx
    Wrote 3 terms to build/terms.tbx
    dropped from tbx: abstract on 1 term, related-terms on 1, see on 1, scope-note on 1
    build/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 as en. -f tbx3 writes the same entries as <conceptEntry>, <langSec> and <termSec>, under <tbx type="TBX-Basic" style="dca">. A set that carries a TBX-Linguist field, such as register or transfer-comments, is written as TBX-Linguist.

  2. 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.csv
    ID,Term [en],Definition [en],Abstract [en],Alt labels [en],Hidden labels [en],Scope note [en],Broader,Narrower,Related terms,See
    bifocal,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-lens

    CSV holds the ten SKOS fields. A TBX field, such as designations or concept-entry, is reported dropped.

The translation team returns the termbase with a German term for each concept, grammatical gender, and a vendor field. This one is TBX v3:

l10n/glossary.tbx
<?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>
  1. 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.tbx
    progressive-lens en progressive lens PAL
    progressive-lens de Gleitsichtglas Gleitsichtbrille
    bifocal en bifocal
    bifocal de Bifokalglas
    4 terms

    A walk of a directory reads a .tbx file it finds, and term.manifests can list one. - reads one from stdin with --as tbx.

  2. 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 its designations item:

    Terminal window
    manni term get PAL l10n/glossary.tbx
    progressive lens l10n/glossary.tbx:15
    id progressive-lens
    language en
    alt-labels PAL
    hidden-labels no-line bifocal
    definition Corrective lenses whose power increases continuously.
    concept-entry subject-field: optics
    designations progressive lens: part-of-speech noun, term-type fullForm
    PAL: term-type acronym
    no-line bifocal: administrative-status superseded
    tbx-elements 1 in concept-entry
    other languages de (Gleitsichtglas)

    The vendor’s Client field has no name in TBX-Basic, so it rides along whole in tbx-elements. The superseded term is a hidden-label that keeps its status. The terminology reference has every field.

  3. 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.tbx
    Nothing to write
    $ manni term write l10n/glossary.tbx -f tbx3 -o build/same.tbx
    Wrote 4 terms to build/same.tbx
    $ cmp l10n/glossary.tbx build/same.tbx && echo identical
    identical

    -f tbx turns 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.tbx
    Wrote 4 terms to build/glossary-v2.tbx
  4. 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 each
    dropped from a page: the header of l10n/glossary.tbx
    docs/glossary/de/progressive-lens.md
    ---
    title: Gleitsichtglas
    type: term
    id: progressive-lens
    language: de
    label: Gleitsichtglas
    definition: Brillenglas mit stufenlos zunehmender Wirkung.
    alt-labels:
    - Gleitsichtbrille
    concept-entry:
    subject-field: optics
    tbx-elements:
    - <descrip type="Client">Acme</descrip>
    designations:
    - term: Gleitsichtglas
    grammatical-gender: neuter
    - term: Gleitsichtbrille
    grammatical-gender: feminine
    ---

    The pages hold every field. The file’s header is not a term, so it stays behind, and the run says so.

  5. 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.tbx
    Wrote 4 terms to build/glossary.tbx

    The entries come in the order the pages are read, and the walk reads de/ before en/. 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 says subject-field: Optik:

    Wrote 4 terms to build/glossary.tbx
    kept 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:

Terminal window
$ manni term write docs/glossary/ -f csv -o build/glossary.csv
Wrote 4 terms to build/glossary.csv
dropped from csv: concept-entry on 2 terms, designations on 2
$ cat build/glossary.csv
ID,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,See
bifocal,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)

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.

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:

l10n/optics.ttl
@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 .
  1. See what is read. Each concept is a term per language its skos:prefLabel holds, with the id its IRI ends in:

    Terminal window
    $ manni term list l10n/optics.ttl
    manni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.
    progressive-lens de Gleitsichtglas
    progressive-lens en progressive lens PAL
    spectacle-lens de Brillenglas
    spectacle-lens en spectacle lens
    4 terms

    A property no term field holds is named once per file on stderr, and the exit code stays 0. A .ttl or .jsonld file is read when you name it, or when term.manifests lists it. A directory walk never picks one up, because manni graph build writes Turtle too. - reads one from stdin with --as skos.

  2. 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.ttl
    manni: l10n/optics.ttl: skos:changeNote is not a term field, so 1 value was not read.
    progressive lens l10n/optics.ttl:1
    id progressive-lens
    language en
    alt-labels PAL
    broader spectacle-lens
    notation OPT-2
    close-matches http://www.wikidata.org/entity/Q1052424
    definition Corrective lenses whose power increases continuously.
    other languages de (Gleitsichtglas)
  3. 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 each
    docs/glossary/de/progressive-lens.md
    ---
    title: Gleitsichtglas
    type: term
    id: progressive-lens
    language: de
    label: Gleitsichtglas
    definition: Brillenglas mit stufenlos zunehmender Wirkung.
    broader:
    - spectacle-lens
    notation: OPT-2
    close-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.

-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:

Terminal window
$ manni term write docs/glossary/ -f skos-ttl -o build/optics.ttl
Wrote 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.

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:

Terminal window
$ manni term write docs/
Nothing to write

A 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>.