You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds BNF and text to change LANGTAG to LANG_DIR to support base direction (#31)
* Adds BNF and text to change LANGTAG to LANG_DIR to support base direction and term constructors for creating directional language-tagged strings.
---------
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Literals are composed of a <adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a> and an optional <adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a> [[!BCP47]] or datatype IRI.
752
+
Literals are composed of a <adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a>
753
+
and an optional <adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a> [[!BCP47]]
754
+
– possibly including a <adata-cite="RDF12-CONCEPTS#dfn-base-direction">base direction</a> –
755
+
or an optional <adata-cite="RDF12-CONCEPTS#dfn-datatype-iri">datatype IRI</a>.
743
756
An extra type, <codeid="prefix" class="dfn">prefix</code>, is used during parsing to map string identifiers to namespace IRIs.
744
757
745
758
This section maps a string conforming to the grammar in <ahref="#grammar-ebnf" class="sectionRef"></a>
@@ -802,23 +815,23 @@ <h3>RDF Term Constructors</h3>
802
815
</thead>
803
816
<tbody>
804
817
<trid="handle-IRIREF" ><tdstyle="text-align:left;" ><aclass="type IRI" href="#grammar-production-IRIREF" ><code>IRIREF</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-iri"> IRI </a></td><td>The characters between "<" and ">" are taken, after the <ahref="#numeric">numeric escape sequences</a> are processed, to form the Unicode string of the IRI. <adata-cite="RDF12-CONCEPTS#dfn-relative-iri">Relative IRI reference</a> resolution is performed per <ahref="#sec-iri-references" class="sectionRef"></a>.</td></tr>
805
-
<trid="handle-PNAME_NS" ><tdstyle="text-align:left;" rowspan="2"><aclass="type string" href="#grammar-production-PNAME_NS" ><code>PNAME_NS</code></a></td><td><ahref="#prefix"> prefix </a></td><td>When used in a <ahref="#grammar-production-prefixID"><code>prefixID</code></a> or <ahref="#grammar-production-sparqlPrefix"><code>sparqlPrefix</code></a> production, the <code>prefix</code> is the potentially empty Unicode string matching the first argument of the rule is a key into the <ahref="#namespaces">namespaces map</a>.</td></tr>
818
+
<trid="handle-PNAME_NS" ><tdstyle="text-align:left;" rowspan="2"><aclass="type string" href="#grammar-production-PNAME_NS" ><code>PNAME_NS</code></a></td><td><ahref="#prefix">prefix </a></td><td>When used in a <ahref="#grammar-production-prefixID"><code>prefixID</code></a> or <ahref="#grammar-production-sparqlPrefix"><code>sparqlPrefix</code></a> production, the <code>prefix</code> is the potentially empty Unicode string matching the first argument of the rule is a key into the <ahref="#namespaces">namespaces map</a>.</td></tr>
806
819
<trid="handle-PNAME-IRI" ><td><adata-cite="RDF12-CONCEPTS#dfn-iri"><code>IRI</code></a></td><td>When used in a <ahref="#grammar-production-PrefixedName"><code>PrefixedName</code></a> production, the <code>iri</code> is the value in the <ahref="#namespaces">namespaces map</a> corresponding to the first argument of the rule.</td></tr>
807
820
<trid="handle-PNAME_LN" ><tdstyle="text-align:left;" ><aclass="type IRI" href="#grammar-production-PNAME_LN" ><code>PNAME_LN</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-iri"><code>IRI</code></a></td><td>A potentially empty <ahref="#prefix">prefix</a> is identified by the first sequence, <ahref="#grammar-production-PNAME_NS"><code>PNAME_NS</code></a>. The <ahref="#namespaces">namespaces map</a><emclass="rfc2119">MUST</em> have a corresponding <code>namespace</code>. The Unicode string of the IRI is formed by unescaping the <ahref="#reserved">reserved characters</a> in the second argument, <ahref="#grammar-production-PN_LOCAL"><code>PN_LOCAL</code></a>, and concatenating this onto the <code>namespace</code>.</td></tr>
<trid="handle-STRING_LITERAL_SINGLE_QUOTE" ><tdstyle="text-align:left;" ><aclass="type lexicalForm" href="#grammar-production-STRING_LITERAL_SINGLE_QUOTE" ><code>STRING_LITERAL_SINGLE_QUOTE</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a></td><td>The characters between the outermost <ahref="#cp-apostrophe"><codetitle="apostrophe">'</code></a>s are taken, with <ahref="#numeric">numeric</a> and <ahref="#string">string</a> escape sequences unescaped, to form the Unicode string of a lexical form.</td></tr>
810
823
<trid="handle-STRING_LITERAL_QUOTE" ><tdstyle="text-align:left;" ><aclass="type lexicalForm" href="#grammar-production-STRING_LITERAL_QUOTE" ><code>STRING_LITERAL_QUOTE</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a></td><td>The characters between the outermost <ahref="#cp-quotation-mark"><codetitle="quotation mark">"</code></a>s are taken, with <ahref="#numeric">numeric</a> and <ahref="#string">string</a> escape sequences unescaped, to form the Unicode string of a lexical form.</td></tr>
811
824
<trid="handle-STRING_LITERAL_LONG_SINGLE_QUOTE"><tdstyle="text-align:left;" ><aclass="type lexicalForm" href="#grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE"><code>STRING_LITERAL_LONG_SINGLE_QUOTE</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a></td><td>The characters between the outermost <ahref="#cp-triple-apostrophe"><code>'''</code></a>s are taken, with <ahref="#numeric">numeric</a> and <ahref="#string">string</a> escape sequences unescaped, to form the unicode string of a lexical form.</td></tr>
812
825
<trid="handle-STRING_LITERAL_LONG_QUOTE" ><tdstyle="text-align:left;" ><aclass="type lexicalForm" href="#grammar-production-STRING_LITERAL_LONG_QUOTE" ><code>STRING_LITERAL_LONG_QUOTE</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-lexical-form">lexical form</a></td><td>The characters between the outermost <ahref="#cp-triple-quote"><code>"""</code></a>s are taken, with <ahref="#numeric">numeric</a> and <ahref="#string">string</a> escape sequences unescaped, to form the Unicode string of a lexical form.</td></tr>
813
-
<trid="handle-LANGTAG" ><tdstyle="text-align:left;" ><aclass="type langTag" href="#grammar-production-LANGTAG" ><code>LANGTAG</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a></td><td>The characters following the <ahref="#cp-at-sign"><codetitle="at sign">@</code></a> form the Unicode string of the language tag.</td></tr>
814
-
<trid="handle-RDFLiteral" ><tdstyle="text-align:left;" ><aclass="type literal" href="#grammar-production-RDFLiteral" ><code>RDFLiteral</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the first rule argument, <code>String</code>, and either a language tag of <code>LANGTAG</code> or a datatype IRI of <code>iri</code>, depending on which rule matched the input. If the <code>LANGTAG</code> rule matched, the datatype is <code>rdf:langString</code> and the language tag is <code>LANGTAG</code>. If neither a language tag nor a datatype IRI is provided, the literal has a datatype of <code>xsd:string</code>.</td></tr>
826
+
<trid="handle-LANG_DIR" ><tdstyle="text-align:left;" ><aclass="type langDir" href="#grammar-production-LANG_DIR" >LANG_DIR</a></td><td><adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a></td><td>The characters following the <ahref="#cp-at-sign"><codetitle="at sign">@</code></a> form the <adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a> and optionally the <adata-cite="RDF12-CONCEPTS#dfn-base-direction">base direction</a>, if the matched characters include <ahref="#cp-hyphen-hyphen"><code>--</code></a>.</td></tr>
827
+
<trid="handle-RDFLiteral" ><tdstyle="text-align:left;" ><aclass="type literal" href="#grammar-production-RDFLiteral" >RDFLiteral </a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the first rule argument, <ahref="#grammar-production-String"><code>String</code></a>. If the <code>'^^' iri</code> rule is matched, the <adata-cite="RDF12-CONCEPTS#dfn-datatype-iri">datatype IRI</a> is derived from the <code>iri</code>, and the literal has no language tag. If the <ahref="#grammar-production-LANG_DIR" class="type langDir"><code>LANG_DIR</code></a> rule is matched, the <adata-cite="RDF12-CONCEPTS#dfn-language-tag">language tag</a> and <adata-cite="RDF12-CONCEPTS#dfn-base-direction">base direction</a> are taken from <ahref=#handle-LANG_DIRclass="type langDir"><code>LANG_DIR</code></a>. If there is no <adata-cite="RDF12-CONCEPTS#dfn-base-direction">base direction</a>, the datatype is <code>rdf:langString</code>. If there is a <adata-cite="RDF12-CONCEPTS#dfn-base-direction">base direction</a>, the datatype is <code>rdf:dirLangString</code>. If neither matched, the datatype is <code>xsd:string</code>, and the literal has no language tag.</td></tr>
815
828
<trid="handle-INTEGER" ><tdstyle="text-align:left;" ><aclass="type integer" href="#grammar-production-INTEGER" ><code>INTEGER</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the input string, and a datatype of <code>xsd:integer</code>.</td></tr>
816
829
<trid="handle-DECIMAL" ><tdstyle="text-align:left;" ><aclass="type decimal" href="#grammar-production-DECIMAL" ><code>DECIMAL</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the input string, and a datatype of <code>xsd:decimal</code>.</td></tr>
817
830
<trid="handle-DOUBLE" ><tdstyle="text-align:left;" ><aclass="type double" href="#grammar-production-DOUBLE" ><code>DOUBLE</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the input string, and a datatype of <code>xsd:double</code>.</td></tr>
818
831
<trid="handle-BooleanLiteral" ><tdstyle="text-align:left;" ><aclass="type boolean" href="#grammar-production-BooleanLiteral" ><code>BooleanLiteral</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-literal"> literal </a></td><td>The literal has a lexical form of the <code>true</code> or <code>false</code>, depending on which matched the input, and a datatype of <code>xsd:boolean</code>.</td></tr>
819
832
<trid="handle-BLANK_NODE_LABEL" ><tdstyle="text-align:left;" ><aclass="type bNode" href="#grammar-production-BLANK_NODE_LABEL" ><code>BLANK_NODE_LABEL</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-blank-node"> blank node </a></td><td>The string matching the second argument, <ahref="#grammar-production-PN_LOCAL"><code>PN_LOCAL</code></a>, is a key in <ahref="#bnodeLabels">bnodeLabels</a>. If there is no corresponding blank node in the map, one is allocated.</td></tr>
<trid="handle-blankNodePropertyList" ><tdstyle="text-align:left;" ><aclass="type bNode" href="#grammar-production-blankNodePropertyList" ><code>blankNodePropertyList</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-blank-node">blank node </a></td><td>A blank node is generated. Note the rules for <code>blankNodePropertyList</code> in the next section.</td></tr>
834
+
<trid="handle-blankNodePropertyList" ><tdstyle="text-align:left;" ><aclass="type bNode" href="#grammar-production-blankNodePropertyList" ><code>blankNodePropertyList</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-blank-node">blank node </a></td><td>A blank node is generated. Note the rules for <code>blankNodePropertyList</code> in the next section.</td></tr>
822
835
<trid="handle-collection" ><tdstyle="text-align:left;" rowspan="2"><aclass="type bNode" href="#grammar-production-collection" ><code>collection</code></a></td><td><adata-cite="RDF12-CONCEPTS#dfn-blank-node"> blank node </a></td><td>For non-empty lists, a blank node is generated. Note the rules for <code>collection</code> in the next section.</td></tr>
823
836
<trid="handle-collection-IRI" ><td><adata-cite="RDF12-CONCEPTS#dfn-iri"> IRI </a></td><td>For empty lists, the resulting IRI is <code>rdf:nil</code>. Note the rules for <code>collection</code> in the next section.</td></tr>
0 commit comments