Skip to content

Commit 43b36d4

Browse files
gkelloggTallTed
andauthored
Updates TriG grammar to be consistent with Turtle. (#38)
* Updates TriG grammar to be consistent with Turtle. * Remove duplicated processor block entries for curReifier and curTripleTerm. --------- Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
1 parent 0cbc0e8 commit 43b36d4

3 files changed

Lines changed: 62 additions & 45 deletions

File tree

spec/index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ <h2>Selected Terminal Literal Strings</h2>
740740
</section>
741741
</section>
742742

743-
<section id="sec-parsing">
743+
<section id="sec-parsing" class="algorithm">
744744
<h2>Parsing</h2>
745745
<p>The RDF Concepts and Abstract Syntax [[!RDF12-CONCEPTS]]
746746
specification defines four types of <a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF term</a>:
@@ -782,6 +782,8 @@ <h3>Parser State</h3>
782782
<li id="curSubject"><a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF Term</a> |curSubject|
783783
— The |curSubject| is bound to the
784784
<a href="#grammar-production-subject"><code>subject</code></a>,
785+
<a href="#grammar-production-rtSubject"><code>rtSubject</code></a>,
786+
<a href="#grammar-production-ttSubject"><code>ttSubject</code></a>,
785787
<a href="#grammar-production-blankNodePropertyList"><code>blankNodePropertyList</code></a>,
786788
<a href="#grammar-production-collection"><code>collection</code></a>,
787789
<a href="#grammar-production-tripleTerm"><code>tripleTerm</code></a>, and
@@ -794,21 +796,22 @@ <h3>Parser State</h3>
794796
is bound to the IRI <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</code>.</li>
795797
<li id="curObject"><a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF Term</a> |curObject| —
796798
The |curObject| is bound to the
797-
<a href="#grammar-production-object"><code>object</code></a> and
799+
<a href="#grammar-production-object"><code>object</code></a>,
800+
<a href="#grammar-production-rtObject"><code>rtObject</code></a>, and
798801
<a href="#grammar-production-ttObject"><code>ttObject</code></a> productions.</li>
799-
<li id="curGraph">RDF_Term |curGraph| —
800-
The |curGraph| is bound to
801-
the label of the graph that is the destination of triples
802-
produced in parsing. When undefined, triples are destined
803-
for the <a data-cite="RDF12-CONCEPTS#dfn-default-graph">default graph</a>.
804-
</li>
805802
<li id="curReifier"><a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF Term</a> |curReifier| —
806803
The |curReifier| is bound to the
807804
<a href="#grammar-production-reifier"><code>reifier</code></a> and
808805
<a href="#grammar-production-annotationBlock"><code>annotationBlock</code></a> productions.</li>
809806
<li id="curTripleTerm"><a data-cite="RDF12-CONCEPTS#dfn-triple-term">Triple term</a> |curTripleTerm| —
810807
The |curTripleTerm| is set in the <a href="#annotation">Annotations</a> constructor.
811808
</li>
809+
<li id="curGraph">RDF_Term |curGraph| —
810+
The |curGraph| is bound to
811+
the label of the graph that is the destination of triples
812+
produced in parsing. When undefined, triples are destined
813+
for the <a data-cite="RDF12-CONCEPTS#dfn-default-graph">default graph</a>.
814+
</li>
812815
</ul>
813816

814817
<p>Term Constructors can create a stack of these values indicated by
@@ -846,8 +849,8 @@ <h3>RDF Term Constructors</h3>
846849
<tr id="handle-blankNodePropertyList" ><td style="text-align:left;" ><a class="type bNode" href="#grammar-production-blankNodePropertyList" ><code>blankNodePropertyList</code></a></td><td><a data-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>
847850
<tr id="handle-collection" ><td style="text-align:left;" rowspan="2"><a class="type bNode" href="#grammar-production-collection" ><code>collection</code> </a></td><td><a data-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>
848851
<tr id="handle-collection-IRI" ><td ><a data-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>
849-
<tr id="handle-reifier" ><td style="text-align:left;" ><a class="type reifier" href="#grammar-production-reifier" >reifier </a></td><td><a data-cite="RDF12-CONCEPTS#dfn-iri"> IRI </a>
850-
| <a data-cite="RDF12-CONCEPTS#dfn-blank-node"> blank node </a></td>
852+
<tr id="handle-reifier" ><td style="text-align:left;" ><a class="type reifier" href="#grammar-production-reifier" >reifier </a></td><td><a data-cite="RDF12-CONCEPTS#dfn-iri"> IRI </a>
853+
| <a data-cite="RDF12-CONCEPTS#dfn-blank-node"> blank node </a></td>
851854
<td>
852855
The |curReifier| is taken from <a data-cite="RDF12-CONCEPTS#dfn-rdf-term">term</a>, which is taken from the matched
853856
<a href="#grammar-production-iri"><code>iri</code></a> production
@@ -974,9 +977,9 @@ <h4>Reified Triples</h4>
974977
records the |curTripleTerm|.
975978
A new <a href="#grammar-production-tripleTerm"><code>tripleTerm</code></a> instance |curTripleTerm|
976979
is created using the
977-
<a href="#grammar-production-subject"><code>subject</code></a>,
980+
<a href="#grammar-production-rtSubject"><code>rtSubject</code></a>,
978981
<a href="#grammar-production-verb"><code>verb</code></a>, and
979-
<a href="#grammar-production-object"><code>object</code></a> productions.
982+
<a href="#grammar-production-rtObject"><code>rtObject</code></a> productions.
980983

981984
Finishing the <a href="#grammar-production-reifiedTriple"><code>reifiedTriple</code></a> production,
982985
if the |curReifier| is not set, it is assigned a fresh RDF <a data-cite="RDF12-CONCEPTS#dfn-blank-node">blank node</a>;

0 commit comments

Comments
 (0)