Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add introduction of triple terms and accompanying Turtle examples #16

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion spec/common/participants.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Members of the RDF-star Working Group Group included Achille Zappa, Adrian Gschwend, Andy Seaborne, Antoine Zimmermann, Dan Brickley, David Chaves-Fraga, Dominik Tomaszuk, Dörthe Arndt, Enrico Franconi, Fabien Gandon, Gregg Kellogg, Gregory Williams, Jesse Wright, Jose Emilio Labra Gayo, Julián Arenas-Guerrero, Olaf Hartig, Ora Lassila, Pasquale Lisena, Peter Patel-Schneider, Pierre-Antoine Champin, Raphaël Troncy, Ruben Taelman, Rémi Ceres, Souripriya Das, Stuart Sutton, Ted Thibodeau, Thomas Pellissier Tanon, Timothée Haudebourg, and Vladimir Alexiev.
Members of the RDF-star Working Group Group included Achille Zappa, Adrian Gschwend, Alan Snyder, Amin Anjomshoaa, Andy Seaborne, Antoine Zimmermann, Dan Brickley, Dave Raggett, Dominik Tomaszuk, Dörthe Arndt, Enrico Franconi, Erich Bremer, Fabien Gandon, Felix Sasaki, Gregg Kellogg, Gregory Williams, Jean-Yves Rossi, Jose Emilio Labra Gayo, Julián Arenas-Guerrero, Kurt Cagle, Niklas Lindström, Olaf Hartig, Ora Lassila, Pasquale Lisena, Peter Patel-Schneider, Pierre-Antoine Champin, Raphaël Troncy, Richard Lea, Ruben Taelman, Rémi Ceres, Souripriya Das, Ted Thibodeau Jr, Thomas Lörtsch, Thomas Pellissier Tanon, Timothée Haudebourg, and Vladimir Alexiev.
11 changes: 11 additions & 0 deletions spec/example-named-annotations.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<bob#me> foaf:topic_interest wd:Q12418 ~ <bob#interest-1>
~ <alice#claim-1> .

<bob#interest-1>
a prov:Influence ;
dcterms:date "1998-10-04"^^xsd:date .

<alice#claim-1>
a rdf:Statement ;
dcterms:date "2004-01-12"^^xsd:date ;
dcterms:creator <alice#me> .
91 changes: 91 additions & 0 deletions spec/example-triple-annotation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions spec/example-unnamed-annotation.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX prov: <http://www.w3.org/ns/prov#>
niklasl marked this conversation as resolved.
Show resolved Hide resolved

niklasl marked this conversation as resolved.
Show resolved Hide resolved
<bob#me> foaf:topic_interest wd:Q12418 {| a prov:Influence ;
dcterms:date "1998-10-04"^^xsd:date |} .
6 changes: 6 additions & 0 deletions spec/example-unnamed-reifier.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
niklasl marked this conversation as resolved.
Show resolved Hide resolved

niklasl marked this conversation as resolved.
Show resolved Hide resolved
<< <bob#me> foaf:topic_interest wd:Q12418 >>
a rdf:Statement ;
dcterms:date "2004-01-12"^^xsd:date ;
dcterms:creator <alice#me> .
29 changes: 29 additions & 0 deletions spec/figures.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
svg {
font-family: sans-serif;
margin: auto;
--bg: #fff;
--fg: #000;
--green: #4aa35b;
--red:red;
--blue: #3575b8;
--purple: #82b;
--white: white;
}

.label { font-size:18px; font-weight:bold }

text.iri { font-size:12px; fill:var(--fg); stroke:none }

.green path { stroke:var(--green) }
.green { fill:var(--green) }

.blue path { stroke:var(--blue) }
.blue { fill:var(--blue) }

.purple path { stroke:var(--purple) }
.purple { fill:var(--purple) }

.arrow text { font-size: 16px }
.arrow textPath { text-anchor: middle }
.arrow path { stroke-width:2.0;marker-end:url(#ConcaveTriangle) }
.arrow.back path { stroke-width:1.6;marker-end:none;marker-start:url(#ConcaveTriangle) }
123 changes: 110 additions & 13 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

editors: [
{ name: "Pierre-Antoine Champin", w3cid: "42931"},
{ name: "Niklas Lindström" },
],

formerEditors: [
Expand Down Expand Up @@ -237,8 +238,8 @@ <h3>Triples</h3>
terms of this abstract syntax. Concrete RDF syntax is introduced
later in <a href="#section-graph-syntax" class="sectionRef"></a>.</p>

<p>In the next three subsections we discuss the three types of RDF data
that occur in triples: IRIs, literals and blank nodes. </p>
<p>In the next four subsections, we discuss the four types of RDF data
that occur in triples: IRIs, literals, blank nodes, and triple terms. </p>

</section>

Expand Down Expand Up @@ -351,6 +352,70 @@ <h3>Blank nodes</h3>
</figure>
</section>

<section id="section-triple-terms">
<h3>Triple terms</h3>

<p>As the basic unit of description in RDF, a triple states a simple,
directed relationship between two resources. Sometimes, we need to describe
more detailed circumstances underlying such relationships. Conceptually, we
can <em>annotate</em> a statement with something more detailed:</p>

<figure id="fig3">
<a href="example-triple-annotation.svg" data-include="example-triple-annotation.svg">
</a>
<figcaption>Informal triple annotation example: a concretization of a
statement described with its own characteristics.</figcaption>
</figure>

<p>In conjunction with the arc expressing the relationship, the dashed circle
in the figure expresses a <a
data-cite="RDF12-CONCEPTS#dfn-reifier">reifier</a>. This is Bob's interest,
with a type and a date of origin, as a concrete circumstance of the fact
that Bob is interested in the Mona Lisa.</p>

<p>Formally, this annotation is composed of four triples:</p>
<pre class="example nohighlight">
&lt;Bob&gt; &lt;is interested in> &lt;the Mona Lisa&gt; .
&lt;Bob's interest> &lt;is a concretization of> <strong>&laquo;&lpar; <small>&lt;Bob&gt; &lt;is interested in> &lt;the Mona Lisa&gt;</small> &rpar;&raquo;</strong> .
&lt;Bob's interest> &lt;is an> &lt;Interest> .
&lt;Bob's interest> &lt;since> &lt;4th of October 1998> .
</pre>

<p>The second triple is called a <a
data-cite="RDF12-CONCEPTS#dfn-reifying-triple">reifying triple</a>, and
expresses a concretization of the proposition stated by the first triple.
The object of a reifying triple is a <a
data-cite="RDF12-CONCEPTS#dfn-triple-term">triple term</a>. It denotes the
proposition itself, as a logical, abstract object identified through its
constituent subject, predicate, and object components.</p>

<p>Triple terms may only appear in the <strong>object position</strong>,
and should be used with the special <em>reifies</em> predicate of reifying
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this should normative?

Suggested change
and should be used with the special <em>reifies</em> predicate of reifying
and SHOULD be used with the special <em>reifies</em> predicate of reifying

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or not?

Suggested change
and should be used with the special <em>reifies</em> predicate of reifying
and ought to be used with the special <em>reifies</em> predicate of reifying

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primer isn't a REC, it is a W3C Working Group Note (at least RDF 1.1 was). The text isn't normative and it does not have the activating text: "The key words ... in this document are to be interpreted as described in RFC 2119."

"should" is fine.

The point of RFC2119 is to have emphasis when a word has spec-significance.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to keep "should" (it is also used in other places in the text). @TallTed do you accept that? (Feel free to just "Resolve conversation" if so. 🙂 )

triples.</p>

<aside class="note">
Relationships can always be described as resources, following the
patterns of <a
href="https://patterns.dataincubator.org/book/qualified-relation.html"
>qualified relations</a> or <a
href="https://patterns.dataincubator.org/book/nary-relation.html"
>N-ary relations</a>, but simple, direct statements are sometimes
preferred over more complex, granular descriptions. Description
authors may need to balance directness and completeness.
Reifying triples is a way of bridging this difference. It enables us
to describe more concrete circumstances, such as events, relationships or
tokens in data sources, <em>in relation to</em> the simple statements.
</aside>
<aside class="note">
Triple terms are used to <em>relate</em> to propositions, not to state
them. This means that we can describe statements without implying them.
This is useful for describing unknown propositions, such as suggestions
or disputed claims.
We can also annotate statements with multiple reifiers, to describe
different circumstances varying in time, location, etc.
</aside>
</section>

<section id="section-multiple-graphs">
<h3>Multiple graphs</h3>

Expand Down Expand Up @@ -417,13 +482,13 @@ <h3>Multiple graphs</h3>
in the intended way. Possible semantics of datasets are described in a separate note
[[RDF11-DATASETS]]. </p>

<figure id="fig3">
<figure id="fig4">
<img class="graph" src="example-multiple-graphs.jpg"
alt="Informal graph of the sample dataset">
<figcaption>Informal graph of the sample dataset</figcaption>
</figure>

<p><a href="#fig3">Fig.&nbsp;3</a> depicts the sample dataset.
<p><a href="#fig4">Fig.&nbsp;4</a> depicts the sample dataset.
<a href="#section-trig" class="sectoinRef"></a> provides an example
of concrete syntax for this dataset.</p>
</section>
Expand Down Expand Up @@ -655,7 +720,7 @@ <h4>N-Triples</h4>

<p>The figure below shows the triples resulting from the example:</p>

<figure id="fig4">
<figure id="fig5">
<img style="width: 75%" src="example-graph-iris.jpg"
alt="Graph of the sample triples">
<figcaption>RDF graph resulting from the N-Triples example</figcaption>
Expand All @@ -679,7 +744,7 @@ <h4>Turtle</h4>
support for namespace prefixes, lists and shorthands for datatyped
literals. Turtle provides a trade-off between ease of
writing, ease of parsing and readability. The graph shown in
<a href="#fig4">Fig.&nbsp;4</a> can be
<a href="#fig5">Fig.&nbsp;5</a> can be
represented in Turtle as follows:</p>

<pre class="example" title="Turtle" id="turtle-example">
Expand Down Expand Up @@ -767,10 +832,42 @@ <h5>Representation of blank nodes</h5>
the square brackets are interpreted as triples with the blank node as
subject. Lines starting with '#' represent
comments. </p>
</section>

<section id="section-turtle-reifier-representation">
<h5>Representations of reifying triples</h5>

<p>Turtle provides concise notation for reifying and annotating
triples. This allows us to encode the example in the section about <a
href="#section-triple-terms">triple terms</a>, where the simple fact
that Bob is interested in the Mona Lisa was annotated with a more
specific circumstance.</p>

<p>We can use an unnamed annotation to state when the interest itself
began:</p>
<pre class="example turtle" title="Unnamed annotation"
data-include="example-unnamed-annotation.ttl"
data-include-format="text">
</pre>

<p>We can also describe that Alice has once made the simple claim. Here
we use syntax for a reifying triple, which references it without
implying its truth:</p>
<pre class="example turtle" title="Unnamed reifier"
data-include="example-unnamed-reifier.ttl"
data-include-format="text">
</pre>

<p>For more details about the syntax of Turtle please consult the Turtle specification [[RDF12-TURTLE]].</p>
<p>The previous two descriptions can also be combined, as two
annotations on one statement. Here we also identify the reifiers with
IRIs:</p>
<pre class="example turtle" title="Named annotations"
data-include="example-named-annotations.ttl"
data-include-format="text">
</pre>
</section>

<p>For more details about the syntax of Turtle please consult the Turtle specification [[RDF12-TURTLE]].</p>
</section>

<section id="section-trig">
Expand Down Expand Up @@ -836,7 +933,7 @@ <h4>TriG</h4>

<p>The figure below shows the triples resulting from this example.</p>

<figure id="fig5">
<figure id="fig6">
<img style="width: 75%" src="example-multiple-graphs-iris.jpg"
alt="Triples resulting from the TriG example">
<figcaption>Triples resulting from the TriG example</figcaption>
Expand Down Expand Up @@ -864,7 +961,7 @@ <h4>N-Quads</h4>
</pre>

<p>The nine lines in the N-Quads example correspond to the nine
arcs in <a href="#fig5">Fig.&nbsp;5</a>. Lines 1-7 represent quads, where the first
arcs in <a href="#fig6">Fig.&nbsp;6</a>. Lines 1-7 represent quads, where the first
element constitutes the graph IRI. The part of the quad after the
graph IRI specifies the
subject, predicate and object of the statement, following the syntactic
Expand Down Expand Up @@ -892,7 +989,7 @@ <h3>JSON-LD</h3>
<a data-cite="JSON-LD11#named-graphs">@graph</a> keyword.</p>

<p>The following JSON-LD example encodes the graph of <a
href="#fig4">Fig.&nbsp;4</a>:</p>
href="#fig5">Fig.&nbsp;5</a>:</p>

<pre class="example" title="JSON-LD">
<span class="linenum">01</span> {
Expand Down Expand Up @@ -992,7 +1089,7 @@ <h3>RDFa</h3>
Snippets</a>). </p>

<p>The HTML example below encodes the
RDF graph depicted in <a href="#fig4">Fig.&nbsp;4</a>:</p>
RDF graph depicted in <a href="#fig5">Fig.&nbsp;5</a>:</p>

<pre class="example" title="RDFa" id="rdfa-example">
<span class="linenum">01</span> &lt;body prefix="foaf: http://xmlns.com/foaf/0.1/
Expand Down Expand Up @@ -1090,7 +1187,7 @@ <h3>RDF/XML</h3>
languages listed here have been adopted and standardized. </p>

<p>The RDF/XML example below encodes the
RDF graph depicted in <a href="#fig4">Fig.&nbsp;4</a>:</p>
RDF graph depicted in <a href="#fig5">Fig.&nbsp;5</a>:</p>

<pre class="example" title="RDF/XML" id="rdf-xml-example">
<span class="linenum">01</span> &lt;?xml version="1.0" encoding="utf-8"?&gt;
Expand Down Expand Up @@ -1360,7 +1457,7 @@ <h2>Changes between RDF 1.0 and RDF 1.1</h2>
<h2>Changes between RDF 1.1 and RDF 1.2</h2>

<ul>

<li>Added information about triple terms (new in RDF 1.2).</li>
</ul>
</section>

Expand Down
Loading