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.

Modification of 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

Literals are used for values such as strings, numbers, and dates.

A literal in an RDF graph consists of two or threefour elements:

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:

  1. If the literal is a language-tagged string, then the literal value is a pairtriple consisting of its lexical form and, its language tag, and its base direction tag, in that order. Either the language tag or the base direction tag may be a undefined value.
  2. If the literal's datatype IRI is in the set of recognized datatype IRIs, let d be the referent of the datatype IRI.
    1. If the literal's lexical form is in the lexical space of d, then the literal value is the result of applying the lexical-to-value mapping of d to the lexical form.
    2. Otherwise, the literal is ill-typed and no literal value can be associated with the literal. Such a case produces a semantic inconsistency but is not syntactically ill-formed. Implementations MUST accept ill-typed literals and produce RDF graphs from them. Implementations MAY produce warnings when encountering ill-typed literals.
  3. If the literal's datatype IRI is not in the set of recognized datatype IRIs, then the literal value is not defined by this specification.

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.