Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/ex-basicenc-output.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ PREFIX ex: <http://example.org/>
_:r1 rdf:reifies _:gen1.
_:r1 ex:q "some value".

_:gen1 a rdf:TripleTerm ;
rdf:ttSubject ex:s;
rdf:ttPredicate ex:p;
rdf:ttObject ex:o.
_:gen1 a rdf:PropositionForm;
rdf:propositionFormSubject ex:s;
rdf:propositionFormPredicate ex:p;
rdf:propositionFormObject ex:o.

40 changes: 19 additions & 21 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ <h2>Interoperability between RDF [=Basic=] and RDF [=Full=]</h2>

<p class=issue>Should we go even further and aim to provide interoperability between <em>RDF 1.1</em> and RDF 1.2 [=Full=]?</p>

<p class=issue>AT RISK: The Working Group may decide to replace the terms `rdf:TripleTerm`, `rdf:ttSubject`, `rdf:ttPredicate`, and `rdf:ttObject` used in this section with other terms, possibly in a different namespace.</p>

<p>These transformation are designed to be:</p>

<dl>
Expand Down Expand Up @@ -112,14 +110,14 @@ <h2>From [=Full=] to [=Basic=]</h2>
and then adding the following [=triples=] to the graph (where <var>s</var>, <var>p</var>, and <var>o</var> are respectively the [=subject=], [=predicate=] and [=object=] of <var>tt</var>):
</p>
<ul>
<li>(<var>b</var>, `rdf:type`, `rdf:TripleTerm`)
<li>(<var>b</var>, `rdf:ttSubject`, <var>s</var>)
<li>(<var>b</var>, `rdf:ttPredicate`, <var>p</var>)
<li>(<var>b</var>, `rdf:ttObject`, <var>o</var>)
<li>(<var>b</var>, `rdf:type`, `rdf:PropositionForm`)
<li>(<var>b</var>, `rdf:propositionFormSubject`, <var>s</var>)
<li>(<var>b</var>, `rdf:propositionFormPredicate`, <var>p</var>)
<li>(<var>b</var>, `rdf:propositionFormObject`, <var>o</var>)
</ul>

<p>Note that this transformation is <em>information preserving</em> only when the input graph either has no [=triple term=] [=appearing=] in it,
or contains no [=asserted triple=] (<var>b</var>, `rdf:type`, `rdf:TripleTerm`) where <var>b</var> is a [=blank node=].
or contains no [=asserted triple=] (<var>b</var>, `rdf:type`, `rdf:PropositionForm`) where <var>b</var> is a [=blank node=].
Implementations encountering this situation ought to report an error.
This limitation is discussed in Section <a href="#section-basicenc-caveat"></a>.
</p>
Expand Down Expand Up @@ -169,13 +167,13 @@ <h2>Example</h2>
<h2>From [=Basic=] to [=Full=]</h2>

<p>Reverting a [=basic encoded=] graph to its original form consists of locating
each [=asserted triple=] (<var>b</var>, `rdf:type`, `rdf:TripleTerm`)
each [=asserted triple=] (<var>b</var>, `rdf:type`, `rdf:PropositionForm`)
that has a [=blank node=] <var>b</var> as its subject,
along with the three associated [=asserted triples=]
that have the same [=blank node=] <var>b</var> as their subjects, i.e.,
(<var>b</var>, `rdf:ttSubject`, <var>s</var>),
(<var>b</var>, `rdf:ttPredicate`, <var>p</var>),
and (<var>b</var>, `rdf:ttObject`, <var>o</var>);
(<var>b</var>, `rdf:propositionFormSubject`, <var>s</var>),
(<var>b</var>, `rdf:propositionFormPredicate`, <var>p</var>),
and (<var>b</var>, `rdf:propositionFormObject`, <var>o</var>);
removing these four [=triples=] from the graph;
and replacing all remaining occurrences of <var>b</var> [=appearing=] in the graph
with the [=triple term=] (<var>s</var>, <var>p</var>, <var>o</var>).
Expand All @@ -184,19 +182,19 @@ <h2>From [=Basic=] to [=Full=]</h2>
<p>An implementation ought to report an error if, for a given <var>b</var>,
it can not unambiguously determine <var>s</var>, <var>p</var>, or <var>o</var>
(i.e., if one of the properties of <var>b</var>
— `rdf:ttSubject`, `rdf:ttPredicate`, or `rdf:ttObject` —
— `rdf:propositionFormSubject`, `rdf:propositionFormPredicate`, or `rdf:propositionFormObject` —
is missing or duplicated).
An implementation also ought to report an error if the input graph contains
at the same time a [=triple term=] and an [=asserted triple=]
(<var>b</var>, `rdf:type`, `rdf:TripleTerm`)
(<var>b</var>, `rdf:type`, `rdf:PropositionForm`)
where <var>b</var> is the same [=blank node=].
Note that none of these situations can occur if the input graph was produced by the [=basic encoding=] transformation.
</p>

<p>To revert a [=basic encoded=] [=RDF dataset=] to its original form, the transformation above is applied to its [=default graph=] and to each of its [=named graphs=].
</p>

<p>Note that this transformation has no effect on any [=RDF graph=] or [=RDF dataset=] that does not use the `rdf:TripleTerm` type,
<p>Note that this transformation has no effect on any [=RDF graph=] or [=RDF dataset=] that does not use the `rdf:PropositionForm` type,
including [=Full=] graphs or datasets containing [=triple terms=].
This makes this transformation <em>idempotent</em> as intended.
</p>
Expand All @@ -206,31 +204,31 @@ <h2>From [=Basic=] to [=Full=]</h2>
<h2>Limitations</h2>

<p>The two transformations above explicitly do not support graphs or datasets containing at the same time a [=triple term=] and an [=asserted triple=]
(<var>b</var>, `rdf:type`, `rdf:TripleTerm`)
(<var>b</var>, `rdf:type`, `rdf:PropositionForm`)
where <var>b</var> is a [=blank node=].
This means that the [=basic encoding=] transformation is not <em>strictly</em> universal.
</p>

<p>This limitation should not be an issue in practice.
The `rdf:TripleTerm` type is unlikely to be in used in any published graph or dataset,
The `rdf:PropositionForm` type is unlikely to be in used in any published graph or dataset,
as it was not defined prior to this specification.
For this reason, using it would actually have been bad practice.
For future graphs and datasets, this type should be considered to be reserved for use within the [=basic encoding=] transformation, and not used otherwise.
</p>

<p class=note>
This is one reason why this transformation introduces new vocabulary terms
(`rdf:TripleTerm`, `rdf:ttSubject`, `rdf:ttPredicate`, `rdf::ttObject`),
(`rdf:PropositionForm`, `rdf:propositionFormSubject`, `rdf:propositionFormPredicate`, `rdf:propositionFormObject`),
rather than repurposing the existing <a data-cite="RDF12-SCHEMA#ch_reificationvocab">reification vocabulary</a>
(`rdf:Statement`, `rdf:subject`, `rdf:predicate`, `rdf:object`).
Unlike `rdf:TripleTerm`, `rdf:Statement` is known to be found in
Unlike `rdf:PropositionForm`, `rdf:Statement` is known to be found in
widely used datasets (e.g., <a href="https://www.uniprot.org/">Uniprot</a>),
so reserving its use for the [=basic encoding=] transformation was not an option.
</p>

<p>Another consequence of this restriction is that implementers will need to be aware and careful when merging graphs in an application that [=basic encoded=] graphs or datasets.
The concern is that merging a [=Full=] [=RDF graph=] containing at least one [=triple term=]
with a [=basic encoded=] [=RDF graph=] (which might contain [=blank node=] instances of `rdf:TripleTerm`)
with a [=basic encoded=] [=RDF graph=] (which might contain [=blank node=] instances of `rdf:PropositionForm`)
could result in a "hybrid" graph that cannot be transformed to a consistent [=Full=] nor [=Basic=] [=RDF graph=].
Therefore, such applications should [=basic encode=] every graph prior to merging them.
Conversely, applications supporting RDF [=Full=] should make sure to apply the reverse transformation
Expand All @@ -254,7 +252,7 @@ <h2>The `basic-encode` algorithm</h2>
<li>Let <var>M</var> be an empty map from [=triple terms=] to [=blank nodes=].</li>
<li>Let <var>inputKind</var> be `null`.</li>
<li>For each [=triple=] (<var>s</var>, <var>p</var>, <var>o</var>) in <var>Gᵢ</var>:<ol>
<li>If <var>s</var> is a [=blank node=], <var>p</var> is `rdf:type` and <var>o</var> is `rdf:TripleTerm`, then:<ol>
<li>If <var>s</var> is a [=blank node=], <var>p</var> is `rdf:type` and <var>o</var> is `rdf:PropositionForm`, then:<ol>
<li id="basicenc-error1">If <var>inputKind</var> is `"full"` then exit with an error.</li>
<li>Otherwise, set <var>inputKind</var> to `"basic"`.</li>
</ol></li>
Expand Down Expand Up @@ -299,7 +297,7 @@ <h2>The `basic-encode-triple-term` algorithm</h2>
</ol></li>
<li id="qtt-fresh-bnode">Let <var>b</var> be a fresh blank node.</li>
<li>Add the association (<var>t</var>, <var>b</var>) to <var>Mₒ</var>.</li>
<li>Add the triples (<var>b</var>, `rdf:type`, `rdf:TripleTerm`), (<var>b</var>, `rdf:ttSubject`, <var>s</var>), (<var>b</var>, `rdf:ttPredicate`, <var>p</var>), and (<var>b</var>, `rdf:ttObject`, <var>o</var>) in <var>G</var>.</li>
<li>Add the triples (<var>b</var>, `rdf:type`, `rdf:PropositionForm`), (<var>b</var>, `rdf:propositionFormSubject`, <var>s</var>), (<var>b</var>, `rdf:propositionFormPredicate`, <var>p</var>), and (<var>b</var>, `rdf:propositionFormObject`, <var>o</var>) in <var>G</var>.</li>
</ol></li>
<li>Return <var>b</var>, <var>Mₒ</var> and <var>G</var>.</li>
</ol>
Expand Down
Loading