Skip to content

Commit

Permalink
Migrate from quoted triples to triple terms
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 12, 2024
1 parent ca14da9 commit 72b9e2c
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7406,44 +7406,43 @@ <h5>TZ</h5>
</section>

<!-- QT -->
<section id="func-quoted-triples">
<h4>Functions on Quoted Triples</h4>
<section id="func-triple-terms">
<h4>Functions on Triple Terms</h4>
<section id="func-triple">
<h5>TRIPLE</h5>
<pre class="prototype nohighlight">
<span class="return">quoted triple</span> <span class="operator">TRIPLE</span> (<span class="type RDFterm">RDF term</span> <span class="name">subj</span>, <span class="type RDFterm">RDF term</span> <span class="name">pred</span>, <span class="type RDFterm">RDF term</span> <span
<span class="return">triple term</span> <span class="operator">TRIPLE</span> (<span class="type RDFterm">RDF term</span> <span class="name">subj</span>, <span class="type RDFterm">RDF term</span> <span class="name">pred</span>, <span class="type RDFterm">RDF term</span> <span
class="name">obj</span>)
</pre>
<pre class="query nohighlight">
<span class="operator">&lt;&lt;</span> subj pred obj <span class="operator">&gt;&gt;</span>
<span class="operator">&lt;&lt;(</span> subj pred obj <span class="operator">)&gt;&gt;</span>
</pre>
<p>
If the 3-tuple (<code style="color:black">subj</code>,
<code style="color:black">pred</code>,
<code style="color:black">obj</code>)
is an <a data-cite="RDF12-CONCEPTS#dfn-rdf-triple">RDF triple</a>
(that is, <code style="color:black">subj</code> is an
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>,
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a> or
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a> or
<a data-cite="RDF12-CONCEPTS#dfn-blank-node">blank node</a>;
<code style="color:black">pred</code> is an
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>;
and <code style="color:black">obj</code> is an
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>,
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
<a data-cite="RDF12-CONCEPTS#dfn-blank-node">blank node</a> or
<a data-cite="RDF12-CONCEPTS#dfn-literal">literal</a>)
the function returns a quoted triple with these three elements.
the function returns a triple term with these three elements.
Otherwise, the function raises an error.
</p>

<p>
As a shorthand notation, the <code>TRIPLE</code> function
can also be written in the form of a
<a href="#rExprQuotedTriple">quoted triple expression</a>
using <code>&lt;&lt;</code> and <code>&gt;&gt;</code>. There is a
<a href="#rExprQuotedTriple">triple term expression</a>
using <code>&lt;&lt;(</code> and <code>)&gt;&gt;</code>. There is a
syntax limitation to this shorthand form: the three elements of
the quoted triple expression can only be variables and directly
the triple term expression can only be variables and directly
written RDF terms, not arbitrary expressions.
In contrast, the function form, <code>TRIPLE</code>,
can be used with arbitrary expressions.
Expand All @@ -7452,7 +7451,7 @@ <h5>TRIPLE</h5>
PREFIX : &lt;http://example/&gt;
SELECT ?s ?date {
?s ?p ?o
BIND( &lt;&lt; ?s ?p ?o &gt;&gt; AS ?qt )
BIND( &lt;&lt;( ?s ?p ?o )&gt;&gt; AS ?qt )
?qt :tripleAdded ?date
}
</pre>
Expand All @@ -7468,45 +7467,45 @@ <h5>TRIPLE</h5>

<section id="func-subject">
<h5>SUBJECT</h5>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">SUBJECT</span> (<span class="type RDFterm">quoted triple</span> <span class="name">quoted-triple</span>)</pre>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">SUBJECT</span> (<span class="type RDFterm">triple term</span> <span class="name">triple-term</span>)</pre>
<p>
If the argument is a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
the function returns the
<a data-cite="RDF12-CONCEPTS#dfn-subject">subject</a>
of the quoted triple.
of the triple term.
If the argument is not a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
an error is raised.
</p>
</section>

<section id="func-predicate">
<h5>PREDICATE</h5>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">PREDICATE</span> (<span class="type RDFterm">quoted triple</span> <span class="name">quoted-triple</span>)</pre>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">PREDICATE</span> (<span class="type RDFterm">triple term</span> <span class="name">triple-term</span>)</pre>
<p>
If the argument is a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
the function returns the
<a data-cite="RDF12-CONCEPTS#dfn-predicate">predicate</a>
of the quoted triple.
of the triple term.
If the argument is not a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
an error is raised.
</p>
</section>

<section id="func-object">
<h5>OBJECT</h5>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">OBJECT</span> (<span class="type RDFterm">quoted triple</span> <span class="name">quoted-triple</span>)</pre>
<pre class="prototype nohighlight"><span class="return">RDF term</span> <span class="operator">OBJECT</span> (<span class="type RDFterm">triple term</span> <span class="name">triple-term</span>)</pre>
<p>
If the argument is a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
the function returns the
<a data-cite="RDF12-CONCEPTS#dfn-object">object</a>
of the quoted triple.
of the triple term.
If the argument is not a
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
<a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
an error is raised.
</p>
</section>
Expand All @@ -7515,7 +7514,7 @@ <h5>OBJECT</h5>
<h5>isTRIPLE</h5>
<pre class="prototype nohighlight"><span class="return">xsd:boolean</span> <span class="operator">isTRIPLE</span> (<span class="type RDFterm">RDF term</span> <span class="name">term</span>)</pre>
<p>
If the argument is a <a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
If the argument is a <a data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>,
the function returns true.
If the argument is any other kind of
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF term</a>,
Expand Down Expand Up @@ -11806,10 +11805,10 @@ <h2>Changes between SPARQL 1.1 Query Language and SPARQL 1.2 Query Language</h2>
Normative changes:
<ul>
<li>Remove concepts of plain and simple literals, in favor of explicit mentions of xsd:string</li>
<li>Update grammar for quoted triples and triple functions in <a href="#sparqlGrammar" class="sectionRef"></a></li>
<li>Update grammar for triple terms and triple functions in <a href="#sparqlGrammar" class="sectionRef"></a></li>
<li>Migrate XML Schema references to 1.1</li>
<li>Update references to XPath from 2.0 to 3.1</li>
<li>Add functions on quoted triples to <a href="#func-quoted-triples" class="sectionRef"></a></li>
<li>Add functions on triple terms to <a href="#func-triple-terms" class="sectionRef"></a></li>
</ul>
</li>
<li>
Expand Down

0 comments on commit 72b9e2c

Please sign in to comment.