From 0e00fa62d4ef3286601e3faf548ed63a3cf1a01e Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Champin Literals are used for values such as strings, numbers, and dates. A literal in an RDF graph consists of
- two, three, or four elements, as follow:Literals
http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
, a
+ to a literal value.http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
or
+ http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString
, a
non-empty language tag as defined by [[!BCP47]]. The
language tag MUST be well-formed according to
section 2.2.9
of [[!BCP47]],
and MUST be treated consistently, that is, in a case insensitive manner.
- Two language tags are the same if they only differ by case.http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString
,
- a non-empty language tag
- that MUST be well-formed according to section 2.2.9
- of [[!BCP47]],
- and MUST be treated consistently, that is, in a case insensitive manner,
- and a base direction that MUST be either `ltr` or `rtl`.A literal is a language-tagged string if the third element is present and the fourth element is not present. - Lexical representations of language tags MAY be case normalized, - (for example, by canonicalizing as defined by - BCP 47 section 4.5). -
- -A literal is a directional language-tagged string + A literal is a directional language-tagged string if both the third element and fourth elements are present. - The third element, the language tag, is treated identically as in a language-tagged string, - and the fourth element, base direction, MUST be either `ltr` or `rtl`, which MUST be in lower case.
- -The meanings of the base direction values are:
-Please note that concrete syntaxes MAY support
- simple literals consisting of only a
- lexical form without any datatype IRI, language tag, or base direction.
- Simple literals are syntactic sugar for abstract syntax
- literals
- with the datatype IRI
- http://www.w3.org/2001/XMLSchema#string
- (which is commonly abbreviated as xsd:string
).
- Similarly, most concrete syntaxes represent
- language-tagged strings and directional language-tagged strings without
- the datatype IRI because it always equals either
- http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
(rdf:langString
)
- or http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString
(rdf:dirLangString
), respectively.
The literal value associated with a literal is:
- -Literal term equality: - Two literals are term-equal (the same RDF literal) + two literals are term-equal (the same RDF term) if and only if:
Comparison is performed using +
Comparison of the [=lexical forms=] and of the [=datatype IRIs=] is performed using case sensitive matching - (see description of string comparison in - ) - except for language tags, where the comparison is performed using + (see description of string comparison in + ). + Comparison of the [=language tags=] is performed using ASCII case-insensitive matching. - 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 forms differ.
+ + +Some concrete syntaxes MAY support
+ simple literals consisting of only a
+ lexical form without any datatype IRI, language tag, or base direction.
+ Simple literals are syntactic sugar for abstract syntax
+ literals
+ with the datatype IRI
+ http://www.w3.org/2001/XMLSchema#string
+ (which is commonly abbreviated as xsd:string
).
+
+ Similarly, most concrete syntaxes represent
+ language-tagged strings and directional language-tagged strings without
+ the datatype IRI because it always equals either
+ http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
(rdf:langString
)
+ or http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString
(rdf:dirLangString
), respectively.
+
+ Any [=string=] complying with [[!BCP47]] MAY be used to represent a [=language tag=] in concrete syntaxes or implementation. + Such strings MAY be case normalized, + (for example, by canonicalizing as defined by + BCP 47 section 4.5). + On the contrary, an implementation MAY preserve the case from the original representation, + provided that it processes it in a case-insensitive manner. +
+ + + +The literal value associated with a literal is defined as follow.
+ ++ Thus, two literals can have the same value + without being the same RDF term. + For example:
+ ++ "1"^^xsd:integer + "01"^^xsd:integer ++ +
denote the same value, but are not the + same literal RDF terms because their + lexical forms differ.
+