Defines the shape describing localised text, stated once per language, together with its constraint types, and
provides the dictionary factory stating them, mapping
JSON-LD language maps to
RDF 1.1 language-tagged strings. A property
whose value varies by language takes one member rather than one per language.
The text stated under each tag is described by an ordinary string shape, so the same
content rules hold for a localised value and its plain counterpart: dictionary(text()) holds every entry to a
single line of plain text, and dictionary(markdown()) keeps every entry verbatim as Markdown.
Important
Contradictory constraints are rejected as the shape is built, so a shape that exists admits at least one value.
Requiring a language that languageIn rules out throws a TraceError, since no
map could then satisfy both constraints at once and the shape would admit nothing.
How many strings a tag carries is fixed by uniqueLang: a unique-tagged
shape gives every tag a single string, and any other gives every tag an array. A member ranging over a dictionary
carries the map whole, never in an array, whatever cardinality it states. A map carrying no text under any tag
counts as no value, so a required localised member stating an empty map fails its cardinality.
The tag-keyed map is the form a value is stored and submitted in. A localised member additionally coalesces under
language negotiation when retrieved, at the same per-tag arity: the value may be retrieved as the negotiated content
alone, and filtered by a plain string operand matched against it under ordinary textual semantics. Submission never
coalesces: it accepts the tag-keyed form alone.
Compatibility
JSON
JSON-LD
RDF 1.1
tag-keyed string map
@language-container language map
language-tagged string literals
Defining language-tagged shapes
Values are tag-keyed maps; the und tag carries content of undetermined
language (a proper name, say), and the zxx tag content with no language at
all (identifiers, codes, formulae):
constlabel = dictionary(text(), { uniqueLang:true }); // a single line of plain text per tag constkeywords = dictionary(string()); // an array of strings per tag constname = dictionary(text({ minLength:1, maxLength:200 })); // length-constrained constabstract = dictionary(markdown(), { languageIn: ["en", "it"] }); // language-restricted Markdown
Dictionary shape types and operations.
Defines the shape describing localised text, stated once per language, together with its constraint types, and provides the dictionary factory stating them, mapping JSON-LD language maps to RDF 1.1 language-tagged strings. A property whose value varies by language takes one member rather than one per language.
The text stated under each tag is described by an ordinary string shape, so the same content rules hold for a localised value and its plain counterpart:
dictionary(text())holds every entry to a single line of plain text, anddictionary(markdown())keeps every entry verbatim as Markdown.Contradictory constraints are rejected as the shape is built, so a shape that exists admits at least one value. Requiring a language that
languageInrules out throws a TraceError, since no map could then satisfy both constraints at once and the shape would admit nothing.How many strings a tag carries is fixed by uniqueLang: a unique-tagged shape gives every tag a single string, and any other gives every tag an array. A member ranging over a dictionary carries the map whole, never in an array, whatever cardinality it states. A map carrying no text under any tag counts as no value, so a required localised member stating an empty map fails its cardinality.
The tag-keyed map is the form a value is stored and submitted in. A localised member additionally coalesces under language negotiation when retrieved, at the same per-tag arity: the value may be retrieved as the negotiated content alone, and filtered by a plain string operand matched against it under ordinary textual semantics. Submission never coalesces: it accepts the tag-keyed form alone.
Compatibility
@language-container language mapDefining language-tagged shapes
Values are tag-keyed maps; the
undtag carries content of undetermined language (a proper name, say), and thezxxtag content with no language at all (identifiers, codes, formulae):Using in resource shapes
A member carries one map whatever cardinality it states, so
keywordsabove reads as a single map of string arrays and never as an array of maps.See