Skip to main content

Language String

Every piece of human-readable text in an OntoUML serialization — an element's name, its description, a note's text, a project's keywords, and so on — is written as a languageString object rather than a plain string. This lets a single model carry its labels and documentation in any number of languages at once.

Structure​

A languageString is a JSON object whose keys are language tags and whose values are the text in that language.

  • JSON type: object
  • Keys: IANA language tags such as en, pt-BR, or de. The empty key "" denotes text in an unknown language.
  • Values: non-empty strings.
{
"en": "Person",
"pt-BR": "Pessoa",
"de": "Person"
}

A single-language value is simply an object with one entry:

{ "en": "My Ontology" }

and text whose language is unspecified uses the empty key:

{ "": "Unknown Language Value" }

Where it is used​

languageString appears wherever text is meant to be read by people and potentially translated. Each property below is described in full on its own page; this table shows only its shape and where that description lives.

PropertyShapeDescribed in
namelanguageString or nulldescriptive properties of every named element
alternativeNameslanguageString[]descriptive properties
descriptionlanguageString or nulldescriptive properties
editorialNoteslanguageString[]descriptive properties
textlanguageStringthe Note element
keywords, bibliographicCitationslanguageString[]the Project element

Note the difference between a single languageString (one multilingual value, as for name) and a languageString[] (a list of multilingual values, as for alternativeNames — each entry is itself a full multilingual object).

Absent versus empty​

Because every property is required, text that has not been provided is not omitted — it is written explicitly:

  • a single optional value such as name is null when unset;
  • a list such as alternativeNames is [] when empty.

An empty object {} is not used to mean "no text"; use null (or [] for a list) instead. A languageString that is present always has at least one entry.

tip

languageString is one of the reusable datatypes; the other value types (id, resource, pointInTime, and point) are described there.