Skip to content

Commit 53b171f

Browse files
afsTallTedpfps
authored
Recognize rdf:dirLangString (#64)
* Recognize rdf:dirLangString * Apply suggestions from code review Co-authored-by: Ted Thibodeau Jr <[email protected]> --------- Co-authored-by: Ted Thibodeau Jr <[email protected]> Co-authored-by: Peter F. Patel-Schneider <[email protected]>
1 parent 6b0098e commit 53b171f

File tree

1 file changed

+70
-31
lines changed

1 file changed

+70
-31
lines changed

spec/index.html

Lines changed: 70 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,11 @@ <h2>Simple Interpretations</h2>
435435
Usage has shown that it is important that every literal have a type.
436436
RDF 1.1 replaces plain literals without language tags by literals typed with
437437
the XML Schema <code>string</code> datatype,
438-
and introduces the special type <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
438+
and introduces the special type
439+
<a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
439440
for language-tagged strings.
440-
The full semantics for typed literals is given in the next section.</p>
441+
The full semantics for typed literals is given in section [[[#datatypes]]].
442+
</p>
441443
</div>
442444

443445
<p class="technote">Simple interpretations are required to interpret all <a>names</a>,
@@ -773,13 +775,14 @@ <h2>Literals and datatypes</h2>
773775

774776
<p>RDF literals and datatypes are fully described in
775777
<a data-cite="RDF12-CONCEPTS#section-Datatypes">Section 5</a> of [[!RDF12-CONCEPTS]].
776-
In summary: with one exception, RDF literals combine a string and an IRI <a data-lt="identify">identifing</a> a datatype.
777-
The exception is <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string">language-tagged strings</a>,
778-
which have two syntactic components, a string and a language tag,
779-
and are assigned the type <code>rdf:langString</code>.
780-
A datatype is understood to define a mapping,
781-
called the
782-
<span id="dfn-lexical-to-value-mapping"><!-- refer to RDF Concepts term --></span>
778+
In summary: with two exceptions, RDF literals combine a string and an IRI <a data-lt="identify">identifying</a> a datatype.
779+
The exceptions are <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string">language-tagged strings</a>, assigned the type <code>rdf:langString</code>,
780+
which have two syntactic components, a string and a language tag; and
781+
<a data-cite="RDF12-CONCEPTS#dfn-directional-language-tagged string">directional language-tagged strings</a>,
782+
assigned the type <code>rdf:dirLangString</code>,
783+
which have three syntactic components, a string, a language tag, and a base direction.
784+
A datatype is understood to define a mapping, called the
785+
<span id="dfn-lexical-to-value-mapping"></span>
783786
<dfn data-cite="RDF12-CONCEPTS#dfn-lexical-to-value-mapping">lexical-to-value mapping</dfn>,
784787
from a lexical space (a set of <a data-cite="RDF12-CONCEPTS#dfn-rdf-string">strings</a>)
785788
to values.
@@ -802,18 +805,38 @@ <h2>Literals and datatypes</h2>
802805
of that datatype.</p>
803806

804807
<p>RDF processors are not required to <a>recognize</a> any datatype IRIs other than
805-
<a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
806-
and <a data-cite="XMLSCHEMA11-2#string"><code>xsd:string</code></a>,
808+
<a data-cite="XMLSCHEMA11-2#string"><code>xsd:string</code></a>,
809+
<a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>, and
810+
<a data-cite="RDF12-CONCEPTS#dfn-dir-lang-string"><code>rdf:dirLangString</code></a>
807811
but when IRIs listed in
808812
<a data-cite="RDF12-CONCEPTS#section-Datatypes">Section 5</a> of [[!RDF12-CONCEPTS]]
809-
are <a>recognized</a>, they MUST be interpreted as described there, and when the IRI <code>rdf:PlainLiteral</code> is <a>recognized</a>, 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 <a>recognized</a>, the mapping between the datatype IRI and the datatype it <a>denotes</a> 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 <a>datatype map</a> of this IRI.</p>
813+
<em>are</em> <a>recognized</a>, they MUST be interpreted as described there, and
814+
when the IRI <code>rdf:PlainLiteral</code> is <a>recognized</a>,
815+
it MUST be interpreted to denote the datatype defined in [[!RDF-PLAIN-LITERAL]].
816+
RDF processors MAY recognize other datatype IRIs,
817+
but when other datatype IRIs are <a>recognized</a>,
818+
the mapping between the datatype IRI and the datatype it <a>denotes</a>
819+
MUST be specified unambiguously,
820+
and MUST be fixed during all RDF transformations or manipulations.
821+
In practice, this can be achieved by the IRI linking
822+
to an external specification of the datatype
823+
which describes both the components of the datatype itself
824+
and the fact that the IRI identifies the datatype,
825+
thereby fixing a value of the <a>datatype map</a> of this IRI.</p>
810826

811827
<p>Literals with <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
812-
as their datatype are an exceptional case which are given a special treatment.
813-
The IRI <code>rdf:langString</code> is classified as a datatype IRI,
814-
and interpreted to denote a datatype, even though no <a>L2V</a> mapping is defined for it.
815-
The <a>value space</a> of <code>rdf:langString</code> is the set of all pairs of a string with a language tag.
816-
The semantics of literals with this as their type are given below.</p>
828+
or <a data-cite="RDF12-CONCEPTS#dfn-directional-language-tagged-string"><code>rdf:dirLangString</code></a>
829+
as their datatype IRI are given special treatment.
830+
The IRIs <code>rdf:langString</code> and <code>rdf:dirLangString</code>
831+
are classified as datatype IRIs and interpreted to denote a datatype,
832+
even though no <a>L2V</a> mapping is defined for them.
833+
The <a>value space</a> of <code>rdf:langString</code>
834+
is the set of all pairs of a string with a language tag.
835+
The <a>value space</a> of <code>rdf:dirLangString</code>
836+
is the set of all
837+
3-tuples of a string, a language tag, and a base direction.
838+
The semantics of literals with either of these as their datatype are given below.
839+
</p>
817840

818841
<p>RDF allows any IRI to be used in a literal,
819842
even when it is not <a>recognized</a> as referring to a datatype.
@@ -844,7 +867,10 @@ <h2>D-interpretations</h2>
844867
<tr><td class="semantictable">If <code>rdf:langString</code> is in D,
845868
then for every language-tagged string E with lexical form sss and language tag ttt,
846869
IL(E)= &lt; sss, ttt' &gt;, where ttt' is ttt converted to lower case using US-ASCII rules</td></tr>
847-
870+
<tr><td class="semantictable">If <code>rdf:dirLangString</code> is in D,
871+
then for every directional language-tagged string E with lexical form sss,
872+
language tag ttt, and base direction bbb,
873+
IL(E)= &lt; sss, ttt', bbb &gt;, where ttt' is ttt converted to lower case using US-ASCII rules</td></tr>
848874
<tr><td class="semantictable">For every other IRI aaa in D,
849875
I(aaa) is the datatype identified by aaa, and for every literal
850876
"sss"^^aaa, IL("sss"^^aaa) = L2V(I(aaa))(sss)</td></tr>
@@ -860,10 +886,12 @@ <h2>D-interpretations</h2>
860886
literals with an unrecognized type IRI are not <a>ill-typed</a> and cannot give rise to
861887
a <a>D-unsatisfiable</a> graph.</p>
862888

863-
<p>The special datatype <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
864-
has no <a>ill-typed</a> literals.
865-
Any syntactically legal literal with this type will denote a value in every
866-
D-interpretation where D includes <code>rdf:langString</code>.
889+
<p>The special datatypes
890+
<a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a> and
891+
<a data-cite="RDF12-CONCEPTS#dfn-directional-language-tagged-string"><code>rdf:dirLangString</code>
892+
have no <a>ill-typed</a> literals.
893+
Any syntactically legal literal with one of these types will denote a value in every
894+
D-interpretation where D includes <code>rdf:langString</code> or <code>rdf:dirLangString</code>.
867895
The only ill-typed literals of type <a data-cite="XMLSCHEMA11-2#string"><code>xsd:string</code></a>
868896
are those containing a Unicode code point which does not match
869897
the <a data-cite="XML11#NT-Char"><em>Char</em> production</a> in [[XML11]].
@@ -873,7 +901,6 @@ <h2>D-interpretations</h2>
873901
ill-typed literals were required to denote a value in IR,
874902
and <a>D-unsatisfiability</a> could be recognized only by using the RDFS semantics.</p>
875903

876-
877904
</section>
878905

879906
<section id="D_entailment">
@@ -960,14 +987,14 @@ <h2>RDF Interpretations</h2>
960987
<tr>
961988
<td ><code>rdf:type rdf:reifies rdf:subject rdf:predicate rdf:object
962989
rdf:first rdf:rest rdf:value rdf:nil
963-
rdf:List rdf:langString rdf:Property rdf:_1 rdf:_2
990+
rdf:List rdf:langString rdf:dirLangString rdf:Property rdf:_1 rdf:_2
964991
...</code></td>
965992
</tr>
966993
</tbody>
967994
</table>
968995

969996
<p>An <dfn>RDF interpretation</dfn> <strong>recognizing D</strong> is a <a>D-interpretation</a> I
970-
where D includes <code>rdf:langString</code> and <code>xsd:string</code>, and which satisfies:</p>
997+
where D includes <code>rdf:langString</code>, <code>rdf:dirLangString</code>, and <code>xsd:string</code>, and which satisfies:</p>
971998

972999
<table>
9731000
<caption>RDF semantic conditions.</caption>
@@ -1006,20 +1033,25 @@ <h2>RDF Interpretations</h2>
10061033
<p>RDF imposes no particular normative meanings on the rest of the RDF vocabulary.
10071034
<a href="#whatnot">Appendix D</a> describes the intended uses of some of this vocabulary.</p>
10081035

1009-
<p>The datatype IRIs <a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>
1036+
<p>The datatype IRIs
1037+
<a data-cite="RDF12-CONCEPTS#dfn-language-tagged-string"><code>rdf:langString</code></a>,
1038+
<a data-cite="RDF12-CONCEPTS#dfn-directional-language-tagged string"><code>rdf:dirLangString</code>,
10101039
and <a data-cite="XMLSCHEMA11-2#string"><code>xsd:string</code></a>
10111040
MUST be <a>recognized</a> by all RDF interpretations.</p>
10121041

1013-
<p>Two other datatypes <a data-cite="RDF12-CONCEPTS#section-XMLLiteral"><code>rdf:XMLLiteral</code></a>
1014-
and <a data-cite="RDF12-CONCEPTS#section-html"><code>rdf:HTML</code></a> are defined in [[!RDF12-CONCEPTS]].
1042+
<p>Three other datatypes &mdash; <a data-cite="RDF12-CONCEPTS#section-XMLLiteral"><code>rdf:XMLLiteral</code></a>,
1043+
<a data-cite="RDF12-CONCEPTS#section-html"><code>rdf:HTML</code></a>, and
1044+
<a data-cite="RDF12-CONCEPTS#section-json"><code>rdf:JSON</code></a> &mdash;
1045+
are defined in [[!RDF12-CONCEPTS]].
10151046
RDF-D interpretations MAY fail to <a>recognize</a> these datatypes.</p>
10161047

10171048
<section id="rdf_entail">
10181049
<h3>RDF entailment</h3>
10191050

10201051
<p>S <dfn>RDF entail</dfn><strong>s</strong> E <strong>recognizing D</strong>
10211052
when every <a>RDF interpretation</a> recognizing D which <a>satisfies</a>
1022-
S also satisfies E. When D is {<code>rdf:langString</code>, <code>xsd:string</code>}
1053+
S also satisfies E. When D is {<code>rdf:langString</code>,
1054+
<code>rdf:dirLangString</code>, <code>xsd:string</code>}
10231055
then we simply say S <strong>RDF entails</strong> E.
10241056
E is <dfn>RDF unsatisfiable</dfn><strong> (recognizing D)</strong>
10251057
when it has no satisfying <a>RDF interpretation</a> (recognizing D).</p>
@@ -1194,6 +1226,7 @@ <h2>RDFS Interpretations</h2>
11941226
<p>LV is defined to be ICEXT(I(<code>rdfs:Literal</code>))</p>
11951227
<p>ICEXT(I(<code>rdfs:Resource</code>)) = IR</p>
11961228
<p>ICEXT(I(<code>rdf:langString</code>)) is the set {I(E) : E a language-tagged string }</p>
1229+
<p>ICEXT(I(<code>rdf:dirLangString</code>)) is the set {I(E) : E a directional language-tagged string }</p>
11971230
<p>for every other IRI aaa in D, ICEXT(I(aaa)) is the <a>value space</a> of I(aaa)</p>
11981231
<p>for every IRI aaa in D, I(aaa) is in ICEXT(I(<code>rdfs:Datatype</code>))</p></td>
11991232
</tr>
@@ -1753,7 +1786,8 @@ <h2>Entailment rules (Informative)</h2>
17531786
<li>If no triples were added in step 2, add the RDF (and RDFS) axiomatic triples which contain <code>rdf:_1</code>.</li>
17541787
<li>For every IRI or literal <code>aaa</code> used in E, add <code>aaa rdf:type rdfs:Resource</code> to S.</li>
17551788
<li>Apply the rules <a>GrdfD1</a>, <a>rdfD1a</a>, and <a>rdfD2</a> (and the rules <a>rdfs1</a> through <a>rdfs13</a>),
1756-
with D={<code>rdf:langString</code>, <code>xsd:string</code>}, to the set in all possible ways, to exhaustion.</li>
1789+
with D={<code>rdf:langString</code>, <code>rdf:dirLangString</code>, <code>xsd:string</code>},
1790+
to the set in all possible ways, to exhaustion.</li>
17571791
</ol>
17581792

17591793
<p>Then we have the completeness result:</p>
@@ -2233,7 +2267,12 @@ <h2>Acknowledgments</h2>
22332267
<h2>Substantive changes since RDF 1.1</h2>
22342268

22352269
<ul>
2236-
<li> RDF entailment rule <a>rdfD1a</a> was added in RDF 1.2. This rule should have been included in RDF 1.1 when the two built-in datatypes (<code>xsd:string</code> and <code>rdf:langString</code>) were added to RDF entailment. </li>
2270+
<li> RDF entailment rule <a>rdfD1a</a> was added in RDF 1.2.
2271+
This rule should have been included in RDF 1.1 when the two built-in
2272+
datatypes (<code>xsd:string</code> and <code>rdf:langString</code>)
2273+
were added to RDF entailment.
2274+
</li>
2275+
<li><code>rdf:dirLangString</code> added to the built-in datatypes.</li>
22372276
</ul>
22382277
</section>
22392278

0 commit comments

Comments
 (0)