Skip to content

Commit cdacfaa

Browse files
afshartigTallTed
authored
Add the 5 RDF-star related function definitions (#92)
* Add the 5 RDF-star related function definitions * Expression <<>> limited to variable and terms * Suggestions from PR review --------- Co-authored-by: Olaf Hartig <[email protected]> Co-authored-by: Ted Thibodeau Jr <[email protected]>
1 parent 6376d23 commit cdacfaa

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

spec/index.html

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7400,6 +7400,127 @@ <h5>TZ</h5>
74007400
</div>
74017401
</section>
74027402
</section>
7403+
7404+
<!-- QT -->
7405+
<section id="func-quoted-triples">
7406+
<h4>Functions on Quoted Triples</h4>
7407+
<section id="func-triple">
7408+
<h5>TRIPLE</h5>
7409+
<pre class="prototype nohighlight">
7410+
<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
7411+
class="name">obj</span>)
7412+
</pre>
7413+
<pre class="query nohighlight">
7414+
<span class="operator">&lt;&lt;</span> subj pred obj <span class="operator">&gt;&gt;</span>
7415+
</pre>
7416+
<p>
7417+
If the 3-tuple (<code style="color:black">subj</code>,
7418+
<code style="color:black">pred</code>,
7419+
<code style="color:black">obj</code>)
7420+
is an <a data-cite="RDF12-CONCEPTS#dfn-rdf-triple">RDF triple</a>
7421+
(that is, <code style="color:black">subj</code> is an
7422+
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>,
7423+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a> or
7424+
<a data-cite="RDF12-CONCEPTS#dfn-blank-node">blank node</a>;
7425+
<code style="color:black">pred</code> is an
7426+
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>;
7427+
and <code style="color:black">obj</code> is an
7428+
<a data-cite="RDF12-CONCEPTS#dfn-iri">IRI</a>,
7429+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7430+
<a data-cite="RDF12-CONCEPTS#dfn-blank-node">blank node</a> or
7431+
<a data-cite="RDF12-CONCEPTS#dfn-literal">literal</a>)
7432+
the function returns a quoted triple with these three elements.
7433+
Otherwise, the function raises an error.
7434+
</p>
7435+
7436+
<p>
7437+
As a shorthand notation, the <code>TRIPLE</code> function
7438+
can also be written in the form of a
7439+
<a href="#rExprQuotedTriple">quoted triple expression</a>
7440+
using <code>&lt;&lt;</code> and <code>&gt;&gt;</code>. There is a
7441+
syntax limitation to this shorthand form: the three elements of
7442+
the quoted triple expression can only be variables and directly
7443+
written RDF terms, not arbitrary expressions.
7444+
In contrast, the function form, <code>TRIPLE</code>,
7445+
can be used with arbitrary expressions.
7446+
</p>
7447+
<pre class="query nohighlight">
7448+
PREFIX : <http://example/>
7449+
SELECT ?s ?date {
7450+
?s ?p ?o
7451+
BIND( &lt;&lt; ?s ?p ?o &gt;&gt; AS ?qt )
7452+
?qt :tripleAdded ?date
7453+
}
7454+
</pre>
7455+
<pre class="query nohighlight">
7456+
PREFIX : <http://example/>
7457+
SELECT ?s ?date {
7458+
?s ?p ?o
7459+
BIND( TRIPLE(?s, ?p, ?o) AS ?qt )
7460+
?qt :tripleAdded ?date
7461+
}
7462+
</pre>
7463+
</section>
7464+
7465+
<section id="func-subject">
7466+
<h5>SUBJECT</h5>
7467+
<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>
7468+
<p>
7469+
If the argument is a
7470+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7471+
the function returns the
7472+
<a data-cite="RDF12-CONCEPTS#dfn-subject">subject</a>
7473+
of the quoted triple.
7474+
If the argument is not a
7475+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7476+
an error is raised.
7477+
</p>
7478+
</section>
7479+
7480+
<section id="func-predicate">
7481+
<h5>PREDICATE</h5>
7482+
<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>
7483+
<p>
7484+
If the argument is a
7485+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7486+
the function returns the
7487+
<a data-cite="RDF12-CONCEPTS#dfn-predicate">predicate</a>
7488+
of the quoted triple.
7489+
If the argument is not a
7490+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7491+
an error is raised.
7492+
</p>
7493+
</section>
7494+
7495+
<section id="func-object">
7496+
<h5>OBJECT</h5>
7497+
<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>
7498+
<p>
7499+
If the argument is a
7500+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7501+
the function returns the
7502+
<a data-cite="RDF12-CONCEPTS#dfn-object">object</a>
7503+
of the quoted triple.
7504+
If the argument is not a
7505+
<a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7506+
an error is raised.
7507+
</p>
7508+
</section>
7509+
7510+
<section>
7511+
<h5>isTRIPLE</h5>
7512+
<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>
7513+
<p>
7514+
If the argument is a <a data-cite="RDF12-CONCEPTS#dfn-quoted-triple">quoted triple</a>,
7515+
the function returns true.
7516+
If the argument is any other kind of
7517+
<a data-cite="RDF12-CONCEPTS#dfn-rdf-term">RDF term</a>,
7518+
the function returns false.
7519+
</p>
7520+
</section>
7521+
</section>
7522+
<!-- QT -->
7523+
74037524
<section id="func-hash">
74047525
<h4>Hash Functions</h4>
74057526
<section id="func-md5">

0 commit comments

Comments
 (0)