From d9d7beee23d41dcbee5b43c9ea9711691fb6dd1b Mon Sep 17 00:00:00 2001
From: Andy Seaborne
Date: Sat, 21 Dec 2024 15:21:20 +0000
Subject: [PATCH 1/2] Recognize rdf:dirLangString
---
spec/index.html | 87 ++++++++++++++++++++++++++++++++-----------------
1 file changed, 57 insertions(+), 30 deletions(-)
diff --git a/spec/index.html b/spec/index.html
index beb5ea5..250d87a 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -419,9 +419,11 @@ Simple Interpretations
Usage has shown that it is important that every literal have a type.
RDF 1.1 replaces plain literals without language tags by literals typed with
the XML Schema string
datatype,
- and introduces the special type rdf:langString
+ and introduces the special type
+ rdf:langString
for language-tagged strings.
- The full semantics for typed literals is given in the next section.
+ The full semantics for typed literals is given in section [[[#datatypes]]].
+
Simple interpretations are required to interpret all names,
@@ -757,13 +759,14 @@
Literals and datatypes
RDF literals and datatypes are fully described in
Section 5 of [[!RDF12-CONCEPTS]].
- In summary: with one exception, RDF literals combine a string and an IRI identifing a datatype.
- The exception is language-tagged strings,
- which have two syntactic components, a string and a language tag,
- and are assigned the type rdf:langString
.
- A datatype is understood to define a partial mapping,
- called the
-
+ In summary: with two exceptions, RDF literals combine a string and an IRI identifing a datatype.
+ The exceptions are language-tagged strings, assigned the type rdf:langString
,
+ which have two syntactic components, a string and a language tag; and
+ directional language-tagged string,
+ assigned the type rdf:dirLangString
,
+ which have three syntactic components, a string, a language tag, and a base direction.
+ A datatype is understood to define a partial mapping, called the
+
lexical-to-value mapping,
from a lexical space (a set of character strings) to values.
The function L2V maps datatypes to their lexical-to-value mapping.
@@ -780,18 +783,26 @@
Literals and datatypes
for that datatype.
RDF processors are not required to recognize any datatype IRIs other than
- rdf:langString
- and xsd:string
,
+ xsd:string
,
+ rdf:langString
, and
+ rdf:dirLangString
but when IRIs listed in
Section 5 of [[!RDF12-CONCEPTS]]
are recognized, they MUST be interpreted as described there, and when the IRI rdf:PlainLiteral
is recognized, it MUST be interpreted to denote the datatype defined in [[!RDF-PLAIN-LITERAL]]. RDF processors MAY recognize other datatype IRIs, but when other datatype IRIs are recognized, the mapping between the datatype IRI and the datatype it denotes MUST be specified unambiguously, and MUST be fixed during all RDF transformations or manipulations. In practice, this can be achieved by the IRI linking to an external specification of the datatype which describes both the components of the datatype itself and the fact that the IRI identifies the datatype, thereby fixing a value of the datatype map of this IRI.
Literals with rdf:langString
- as their datatype are an exceptional case which are given a special treatment.
- The IRI rdf:langString
is classified as a datatype IRI,
- and interpreted to denote a datatype, even though no L2V mapping is defined for it.
- The value space of rdf:langString
is the set of all pairs of a string with a language tag.
- The semantics of literals with this as their type are given below.
+ or rdf:dirLangString
+ as their datatype IRI are given special treatment.
+ The IRIs rdf:langString
and rdf:dirLangString
+ are classified as datatype IRIs and interpreted to denote a datatype,
+ even though no L2V mapping is defined for them.
+ The value space of rdf:langString
+ is the set of all pairs of a string with a language tag.
+ The value space of rdf:dirLangString
+ is the set of all
+ 3-tuples of a string, a language tag, and a base direction.
+ The semantics of literals with these as their datatype are given below.
+
RDF allows any IRI to be used in a literal,
even when it is not recognized as referring to a datatype.
@@ -822,7 +833,10 @@
D-interpretations
If rdf:langString is in D,
then for every language-tagged string E with lexical form sss and language tag ttt,
IL(E)= < sss, ttt' >, where ttt' is ttt converted to lower case using US-ASCII rules |
-
+ If rdf:dirLangString is in D,
+ then for every directional language-tagged string E with lexical form sss,
+ language tag ttt, and base direction bbb,
+ IL(E)= < sss, ttt', bbb >, where ttt' is ttt converted to lower case using US-ASCII rules |
For every other IRI aaa in D,
I(aaa) is the datatype identified by aaa, and for every literal
"sss"^^aaa, IL("sss"^^aaa) = L2V(I(aaa))(sss) |
@@ -838,10 +852,12 @@ D-interpretations
literals with an unrecognized type IRI are not ill-typed and cannot give rise to
a D-unsatisfiable graph.
- The special datatype rdf:langString
- has no ill-typed literals.
- Any syntactically legal literal with this type will denote a value in every
- D-interpretation where D includes rdf:langString
.
+
The special datatypes
+ rdf:langString
and
+ rdf:dirLangString
+ have no ill-typed literals.
+ Any syntactically legal literal with one of these types will denote a value in every
+ D-interpretation where D includes rdf:langString
or rdf:dirLangString
.
The only ill-typed literals of type xsd:string
are those containing a Unicode code point which does not match
the Char production in [[XML11]].
@@ -851,7 +867,6 @@
D-interpretations
ill-typed literals were required to denote a value in IR,
and D-unsatisfiability could be recognized only by using the RDFS semantics.
-
@@ -938,14 +953,14 @@ RDF Interpretations
rdf:type rdf:subject rdf:predicate rdf:object
rdf:first rdf:rest rdf:value rdf:nil
- rdf:List rdf:langString rdf:Property rdf:_1 rdf:_2
+ rdf:List rdf:langString rdf:dirLangString rdf:Property rdf:_1 rdf:_2
... |
An RDF interpretation recognizing D is a D-interpretation I
- where D includes rdf:langString
and xsd:string
, and which satisfies:
+ where D includes rdf:langString
, rdf:dirLangString
and xsd:string
, and which satisfies:
RDF semantic conditions.
@@ -983,12 +998,16 @@ RDF Interpretations
RDF imposes no particular normative meanings on the rest of the RDF vocabulary.
Appendix D describes the intended uses of some of this vocabulary.
- The datatype IRIs rdf:langString
+
The datatype IRIs
+ rdf:langString
,
+ rdf:dirLangString
,
and xsd:string
MUST be recognized by all RDF interpretations.
- Two other datatypes rdf:XMLLiteral
- and rdf:HTML
are defined in [[!RDF12-CONCEPTS]].
+
Three other datatypes, rdf:XMLLiteral
,
+ rdf:HTML
and
+ rdf:JSON
,
+ are defined in [[!RDF12-CONCEPTS]].
RDF-D interpretations MAY fail to recognize these datatypes.
@@ -996,7 +1015,8 @@ RDF entailment
S RDF entails E recognizing D
when every RDF interpretation recognizing D which satisfies
- S also satisfies E. When D is {rdf:langString
, xsd:string
}
+ S also satisfies E. When D is {rdf:langString
,
+ rdf:dirLangString
, xsd:string
}
then we simply say S RDF entails E.
E is RDF unsatisfiable (recognizing D)
when it has no satisfying RDF interpretation (recognizing D).
@@ -1152,6 +1172,7 @@ RDFS Interpretations
LV is defined to be ICEXT(I(rdfs:Literal
))
ICEXT(I(rdfs:Resource
)) = IR
ICEXT(I(rdf:langString
)) is the set {I(E) : E a language-tagged string }
+ ICEXT(I(rdf:dirLangString
)) is the set {I(E) : E a directional language-tagged string }
for every other IRI aaa in D, ICEXT(I(aaa)) is the value space of I(aaa)
for every IRI aaa in D, I(aaa) is in ICEXT(I(rdfs:Datatype
))
@@ -1616,7 +1637,8 @@ Entailment rules (Informative)
If no triples were added in step 2, add the RDF (and RDFS) axiomatic triples which contain rdf:_1
.
For every IRI or literal aaa
used in E, add aaa rdf:type rdfs:Resource
to S.
Apply the rules GrdfD1, rdfD1a, and rdfD2 (and the rules rdfs1 through rdfs13),
- with D={rdf:langString
, xsd:string
}, to the set in all possible ways, to exhaustion.
+ with D={rdf:langString
, rdf:dirLangString
, xsd:string
},
+ to the set in all possible ways, to exhaustion.
Then we have the completeness result:
@@ -2069,7 +2091,12 @@ Acknowledgments
Substantive changes since RDF 1.1
- - RDF entailment rule rdfD1a was added in RDF 1.2. This rule should have been included in RDF 1.1 when the two built-in datatypes (
xsd:string
and rdf:langString
) were added to RDF entailment.
+ - RDF entailment rule rdfD1a was added in RDF 1.2.
+ This rule should have been included in RDF 1.1 when the two built-in
+ datatypes (
xsd:string
and rdf:langString
)
+ were added to RDF entailment.
+
+ rdf:dirLangString
added to the built-in datatypes.
From 16a5ced826c74de8f275174e14755ff516f21907 Mon Sep 17 00:00:00 2001
From: Andy Seaborne
Date: Thu, 16 Jan 2025 21:36:22 +0000
Subject: [PATCH 2/2] Apply suggestions from code review
Co-authored-by: Ted Thibodeau Jr
---
spec/index.html | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/spec/index.html b/spec/index.html
index 250d87a..f9cca29 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -759,10 +759,10 @@ Literals and datatypes
RDF literals and datatypes are fully described in
Section 5 of [[!RDF12-CONCEPTS]].
- In summary: with two exceptions, RDF literals combine a string and an IRI identifing a datatype.
+ In summary: with two exceptions, RDF literals combine a string and an IRI identifying a datatype.
The exceptions are language-tagged strings, assigned the type rdf:langString
,
which have two syntactic components, a string and a language tag; and
- directional language-tagged string,
+ directional language-tagged strings,
assigned the type rdf:dirLangString
,
which have three syntactic components, a string, a language tag, and a base direction.
A datatype is understood to define a partial mapping, called the
@@ -788,7 +788,19 @@
Literals and datatypes
rdf:dirLangString
but when IRIs listed in
Section 5 of [[!RDF12-CONCEPTS]]
- are recognized, they MUST be interpreted as described there, and when the IRI rdf:PlainLiteral
is recognized, it MUST be interpreted to denote the datatype defined in [[!RDF-PLAIN-LITERAL]]. RDF processors MAY recognize other datatype IRIs, but when other datatype IRIs are recognized, the mapping between the datatype IRI and the datatype it denotes MUST be specified unambiguously, and MUST be fixed during all RDF transformations or manipulations. In practice, this can be achieved by the IRI linking to an external specification of the datatype which describes both the components of the datatype itself and the fact that the IRI identifies the datatype, thereby fixing a value of the datatype map of this IRI.
+ are recognized, they MUST be interpreted as described there, and
+ when the IRI rdf:PlainLiteral
is recognized,
+ it MUST be interpreted to denote the datatype defined in [[!RDF-PLAIN-LITERAL]].
+ RDF processors MAY recognize other datatype IRIs,
+ but when other datatype IRIs are recognized,
+ the mapping between the datatype IRI and the datatype it denotes
+ MUST be specified unambiguously,
+ and MUST be fixed during all RDF transformations or manipulations.
+ In practice, this can be achieved by the IRI linking
+ to an external specification of the datatype
+ which describes both the components of the datatype itself
+ and the fact that the IRI identifies the datatype,
+ thereby fixing a value of the datatype map of this IRI.
Literals with rdf:langString
or rdf:dirLangString
@@ -801,7 +813,7 @@
Literals and datatypes
The value space of rdf:dirLangString
is the set of all
3-tuples of a string, a language tag, and a base direction.
- The semantics of literals with these as their datatype are given below.
+ The semantics of literals with either of these as their datatype are given below.
RDF allows any IRI to be used in a literal,
@@ -960,7 +972,7 @@
RDF Interpretations
An RDF interpretation recognizing D is a D-interpretation I
- where D includes rdf:langString
, rdf:dirLangString
and xsd:string
, and which satisfies:
+ where D includes rdf:langString
, rdf:dirLangString
, and xsd:string
, and which satisfies: