Language strings in generators
A value of the langstring type, imported from linkml:types, is a plain string or a non-empty mapping from language tag to text:
name: Bookname: en: Book pl: KsiążkaGenerators accept both forms:
- JSON Schema:
anyOfa string and a non-empty object with string values. - TypeScript:
string | Record<string, string>. - Pydantic:
str | Annotated[dict[str, str], Field(min_length=1)]. - RDFS:
rdfs:range rdf:PlainLiteral, as for OWL. - GraphQL: a custom scalar,
Langstring, as GraphQL has no unions of scalars. - Frictionless: an
anyfield, as a CSV cell holds a plain string or a JSON object from language tag to text. Ananyfield can’t have lengths or a pattern, so they are not checked. - SHACL:
sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ). A single-valued slot holds one plain string, or texts in different languages (sh:uniqueLang true). - OWL:
rdf:PlainLiteral. A single-valued slot is not functional, as a text in several languages is one literal per language. It has at most one plain string (owl:maxQualifiedCardinality 1onxsd:string).
The lengths and the pattern of a langstring slot apply to a plain string and to the text in each language.