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
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> .
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> .
97 changes: 94 additions & 3 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>
niklasl marked this conversation as resolved.
Show resolved Hide resolved

</section>

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

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

<p>As the basic unit of description in RDF, the triple is a simple

Choose a reason for hiding this comment

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

Trying to use less words to say the same thing (likely a matter of writing style, but still, I think simplicity is important for a primer)

As the atomic unit of description in RDF, the triple (or statement) states a directed relationship between two resources. Sometimes, we need to describe this relationship itself in more detail.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to @william-vw 's proposal

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this is better. While I also prefer "atomic" (as in "atomic proposition"), there have been some reactions to using that (since triples have components). That's why I used "basic". But I'll try this out. Keep commenting if something even better comes to mind.

abstraction for stating a directed relationship between two resources.
Sometimes we need to describe more detailed circumstances underlying such
niklasl marked this conversation as resolved.
Show resolved Hide resolved
relationships. While we can describe these using more sophisticated
gkellogg marked this conversation as resolved.
Show resolved Hide resolved
modelling, there is a tension between simple, direct statements and more
niklasl marked this conversation as resolved.
Show resolved Hide resolved
complex, granular descriptions. This may require a trade-off between
directness and completeness.</p>

Choose a reason for hiding this comment

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

Instead of going into details, how about following the above paragraph directly with an example:

For instance, given the following:

<Bob> <is interested in> <the Mona Lisa>

We may want to say the following about the relationship:

<Bob> <is interested in> <the Mona Lisa> 
    <is an> <Interest>
    <4th of October 1998>

Copy link
Author

Choose a reason for hiding this comment

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

Going into details is what this is about, but I appreciate your advice to approach it gently. However, your suggested form can be misleading, as it appears to conflate the proposition with a circumstance thereof.

Choose a reason for hiding this comment

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

I feel like <Bob> <is interested in> <the Mona Lisa> is already quite specific - it does not reflect a need for an occurrence / token. (Avoiding the discussion on whether occurrences are always needed.) Hence, I didn't see an issue with this particular example.

E.g., <the Mona Lisa> <depicts> <cypress tree> could be found in many different sources and at different dates.

Copy link
Author

Choose a reason for hiding this comment

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

I think in this PR we should focus on how to use reifiers, and continue the debate on why they are needed in w3c/rdf-star-wg#138? The primer should convey the design, but not all of the theory. (Perhaps RDF Concepts needs to cover more of that? Or Semantics; after all, it is where the original reification documentation resides.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I would actually prefer a graphical example, building on the figure we already have.
Below is a quick and dirty experiment

image

Note that I just had the idea of linking the arc to the reifier with a wiggly line, which is reminiscent of the tilda we use in Turtle :-)

Copy link

@william-vw william-vw Dec 11, 2024

Choose a reason for hiding this comment

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

Triple terms can only appear in the object position, and should only be used as the object of a special predicate representing this "concretization" relation.

Depending on the outcome of the discussion, this statement can be weakened.

Choose a reason for hiding this comment

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

Conceptually, we can annotate a simple statement with a reference to something more detailed.

[figure]

The dotted circle above the "is intersted in" arc is called a reifier and expresses a concrete circumstance of Bob's interest, with a type and a date of origin.

I feel there is a non sequitur here; the terms annotate, reference and details are no longer used in the second part.

A suggestion:

Conceptually, we can annotate a simple statement with something more detailed.
[figure]

The dotted circle annotates the "is interested in" arc and is called a reifier.
A reifier expresses a concrete circumstance of Bob's interest, and details it with a type and a date of origin.

Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling that confusion will increase due to a <Interest> and <is interested in>. Changing the latter to <hasInterest> might be enough to solve this.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you @william-vw and @pchampin for these suggestions! I've tried to work much of that into 051a328.

Copy link
Author

Choose a reason for hiding this comment

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

@TallTed:

I have a feeling that confusion will increase due to a <Interest> and <is interested in>. Changing the latter to <hasInterest> might be enough to solve this.

The <is interested in> is the more abstract binary relationship, following the existing example in the primer. Changing it to <hasInterest> implies remodelling, to instead link from <Bob> to the reified <Interest>. That would be better modelling if such interests as resources where of primary interest (heh). But the point here is to show how such more detailed interests can link to the simple proposition itself, as a reification thereof. Thus allowing us to keep the (arguably too) simple relationship.

<p>To bridge this difference, we can use <a
data-cite="RDF12-CONCEPTS#dfn-triple-term">triple terms</a> as
<em>references</em> to simple statements. A triple term is a fixed object
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure what "fixed" is supposed to mean here. Are there any objects in an RDF graph, that are not "fixed"?

Copy link
Author

Choose a reason for hiding this comment

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

No, I guess there aren't. (Except maybe bnodes?)

That phrasing is an attempt to hint at the unicity ("type nature") of the propositions denoted by triple terms. But I'll seek to rephrase this as I'm working your other suggestions into the text. (Reordering; adding a figure; cutting or shortening.)

that identifies a statement through its constituent subject, predicate and
object.</p>
gkellogg marked this conversation as resolved.
Show resolved Hide resolved

<p>This enable us to describe more concrete circumstances, such as events,
gkellogg marked this conversation as resolved.
Show resolved Hide resolved
relationship entities or tokens in data sources, <em>in relation to</em>
the simple statements. That allows us to keep them as is, rather than
requiring a complete remodelling into more detailed structures, for the
sake of occasionally adding details.</p>

<p>Conceptually, we can <em>annotate</em> a simple statement with a
Copy link

@william-vw william-vw Dec 9, 2024

Choose a reason for hiding this comment

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

I think I understand the reason for the original example - annotations as a segue to reifiers - but I felt it difficult to understand. Perhaps due to its format (with the tilde) being not immediately clear to me, it no longer mentioning triple terms (so it felt like a bit of a non-sequitur), and it introducing another concept (IMO unnecessarily, namely "annotation").

Perhaps it could be simplified as follows:

This can be done using triple terms as references to statements. A triple term is a fixed object that identifies a statement using its subject, predicate and object components. For instance:

⟪ <Bob> <is interested in> <the Mona Lisa> ⟫

In turn, triple terms can be "concretized" using so-called reifiers. Here, a reifier turns Bob's interest into a concrete circumstance, which can then be described:

<Bob's interest> <reifies> ⟪ <Bob> <is interested in> <the Mona Lisa> ⟫ .
<Bob's interest> <is an> <Interest> .
<Bob's interest> <since> <4th of October 1998> .

Copy link
Author

Choose a reason for hiding this comment

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

The advice from e.g. @franconi during the last Semantic TF meeting was (IIUC) to concentrate on annotations. I agree, admittedly based on my library work, where the bulk of our use cases for RDF-star utilize those. To mitigate that bias, I've looked elsewhere too. Other sentiments appear to confirm this; see e.g. this post by Bob DuCharme. My experiments with our collected use cases (including Wikidata and Uniprot descriptions adapted to this form) mostly seem to confirm this as well.

So my goal here, which might not be achieved yet, is to begin with that and then explain how such "footnotes with details" are expressed trough reifying triples.

Copy link

@william-vw william-vw Dec 10, 2024

Choose a reason for hiding this comment

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

Your explanation of "footnotes with details" makes it clearer what your intent was :-)

I can see an analogy with Wikipedia where a claim can be "backed" by multiple citations; each of those citations can then have separate provenance data.
(To me, a footnote provides singular details on a claim; it would rather be in line with the triple term as subject view.)

In other words, the analogy wasn't fully clear to me ...

Copy link
Contributor

Choose a reason for hiding this comment

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

I also believe that annotations are the easiest path to come to triple terms. That was the original RDF-star use case (where embedded triples were also automatically asserted).

reference to something more detailed:</p>
<pre class="example nohighlight">
&lt;Bob&gt; &lt;is interested in> &lt;the Mona Lisa&gt; <sup><strong>~ &lt;Bob's interest></strong></sup> .
</pre>

<p>This annotation refers to Bob's interest as a concrete circumstance, with
a date of origin:</p>
<pre class="example nohighlight">
&lt;Bob's interest> &lt;is an> &lt;Interest> .
&lt;Bob's interest> &lt;since> &lt;4th of October 1998> .
</pre>

<p>Formally, an annotation is formed by two triples: the statement itself
and a <a data-cite="RDF12-CONCEPTS#dfn-reifying-triple">reifying
triple</a>. This expresses the simple relationship and the reifying relation to that from the circumstance, as a concretization thereof:</p>

Choose a reason for hiding this comment

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

This sentence took many readings (I think I still don't understand it) :-)

This expresses the simple relationship and the reifying relation to that from the circumstance, as a concretization thereof

Copy link
Author

Choose a reason for hiding this comment

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

Point taken; it got a bit twisted during a rewrite. How about:

This expresses, on the one hand, the relationship as an abstract statement, and on the other, the circumstance as a concretization of that abstraction.

?

<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> .
</pre>

<p><a data-cite="RDF12-CONCEPTS#dfn-reifier">Reifiers</a> are subjects of
triples relating to triple terms using the <code>rdf:reifies</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

pnames have not been introduced yet, so this should rather be the full IRI (or an abstract description thereof).

Copy link
Author

Choose a reason for hiding this comment

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

I thank you for these and refer to 051a328 to see if that is more satisfactory.

predicate. Triple terms should only appear in the <strong>object
position</strong> of such reifying triples.</p>

<p>Note that triple terms only <em>reference</em> statements. This means
that we can describe statements without implying them. This is useful for
describing unknown propositions such as suggestions or disputed claims. We
niklasl marked this conversation as resolved.
Show resolved Hide resolved
can also annotate statements with multiple reifiers, to describe different

Choose a reason for hiding this comment

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

It would be great if we could elaborate on that aspect, since it outlines the practical benefits of using reifiers.

Copy link
Author

Choose a reason for hiding this comment

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

Agree here too; see 051a328.

circumstances varying on time, location, etc.</p>
niklasl marked this conversation as resolved.
Show resolved Hide resolved

<aside class="note">Triple terms were added to the RDF data model in RDF 1.2.</aside>

Choose a reason for hiding this comment

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

We could also add a separate info box on alternatives:

<aside class="note">
We could describe triples using more sophisticated modelling. ...
Using triple terms allows us to keep triples as is, rather than requiring a complete remodelling into more detailed structures, for the sake of occasionally adding details. ...
</aside>

Copy link
Author

Choose a reason for hiding this comment

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

Agreed. Please see if 051a328 addresses this.

</section>

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

Expand Down Expand Up @@ -767,10 +826,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>For more details about the syntax of Turtle please consult the Turtle specification [[RDF12-TURTLE]].</p>
<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>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
Loading