This is the draft of the necessary modification of [[rdf11-concepts]] in case the approach is to extend the current langString
built-in literal. See the core document for further details.
langString
in the RDF 1.1 Concepts document
The current definition for langString
is in section 3.3 of the RDF 1.1 document. The subsection below proposes a replacement for that sections, with the changes highlighted.
Literals are used for values such as strings, numbers, and dates.
A literal in an RDF graph consists of two or threefour elements:
http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
, either a non-empty language tag as defined by [[bcp47]], or and a non-empty base direction tag, or both. The language tag, if any, MUST be well-formed according to section 2.2.9 of [[BCP47]]. The base direction tag, if any, MUST have the value of ltr
, rtl
, semantically defined for the dir
attribute in [[html]].
A literal is a language-tagged string if the third and/or the fourth elements isare present. Lexical representations of language tags MAY be converted to lower case. The value space of language tags is always in lower case.
Please note that concrete syntaxes MAY support simple literals consisting of only a lexical form without any datatype IRI or, language tag , or base direction tag. Simple literals are syntactic sugar for abstract syntax literals with the datatype IRI http://www.w3.org/2001/XMLSchema#string
. Similarly, most concrete syntaxes represent language-tagged strings without the datatype IRI because it always equals http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
.
The literal value associated with a literal is:
undefined
value.Literal term equality: Two literals are term-equal (the same RDF literal) if and only if the two lexical forms, the two datatype IRIs, and the two language tags and base direction tags (if any) compare equal, character by character. Thus, two literals can have the same value without being the same RDF term. For example:
"1"^^xs:integer "01"^^xs:integer
denote the same value, but are not the same literal RDF terms and are not term-equal because their lexical form differs.
The datatype IRI http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
may seem confusing, since literals with this datatype may have only a base direction tag and no language tag. It was so named in a previous version of RDF where only language tags existed, and has been kept as is for backward compatibility reasons.