From 8e07ca3dd592b9b32049ace3e3e0995bf9d1a0b1 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Champin This specification establishes two conformance levels: This section provides transformations between RDF [=Classic=] datasets and RDF [=Full=] datasets,
+ to provide some level of interoperability between the different classes of Conformance.
+
+ Should we go even further and aim to provide interoperability between RDF 1.1 and RDF 1.2 [=Full=]? It defines the `unstar` algorithm, which transforms an RDF [=Full=] dataset into an RDF [=Classic=] dataset by encoding all triple-terms into dedicated named graphs.
+ This algorithm is designed to be:
+ The general principle of the `unstar` algorithm is to replace each triple term `S P O` in the input dataset with a fresh blank node.
+ This blank node is then use as the name of a new named graph containing a single triple `S P O`.
+ In order to distinguish those new named graphs from the original named graphs of the input dataset,
+ dedicated triples are added to a special `rdf:unstarMetadata` named graph. The blank nodes generated by `unstar` to replace triple terms should not be confused with the reifiers that are typically associated to these triple terms. Despite having the same name, the `unstar` mapping defined in this specification is different from the `unstar` mapping defined in [[RDF-STAR-CG]]. The algorithm expects one input variable Dᵢ which is an RDF dataset. It returns a [=Classic=] RDF dataset.
+ In the algorithm, we adopt the view presented in .
+ This algorithm is responsible for incrementally populating the mapping M and the dataset D used internally by the `unstar` algorithm. It receives a triple term as input and processes it recursively (in case its object is itself a triple term). It returns, among other things, the blank node minted to replace the triple term in the transformed [=Classic=] RDF dataset. This algorithm expects two input variables:
+ a triple term t,
+ and a map Mᵢ from triple terms to blank nodes.
+ It returns a blank node b,
+ a map Mₒ from triple terms to blank nodes,
+ and a [=Classic=] RDF dataset D.
+ In the algorithm, we adopt the view presented in .
+
+ In step 4.3 of this algorithm,
+ it is assumed that the blank node b is distinct from any blank node already in use in any dataset at hand,
+ in particular the dataset being processed in the invoking `unstar` algorithm.
+ Some implementations may require that `unstar` passes that dataset to `quote-triple-term` to ensure this constraint.
+ Steps 4.1.1 and 4.2.1 of the `unstar` algorithm exit with an error.
+ This will occur if the input dataset contains at the same time triple terms and a graph named `rdf:unstarMetadata`.
+ The `unstar` algorithm is therefore not strictly universal as it can not transform this particular kind of datasets.
+ This limitation should not be an issue in practice.
+ The special graph name `rdf:unstarMapping` is unlikely to be in used in any published dataset,
+ as it was not defined in the RDF namespace prior to this specification.
+ For this reason, using it would actually have been bad practice.
+ As for future datasets, their authors should consider the graph name `rdf:unstarMetadata` to be reserved, in order to prevent interference with the `unstar` algorithm.
+ Another consequence of this restriction is that users should be careful when merging dataset in an application that makes use of the `unstar` algorithm.
+ More precisely, merging a [=Full=] RDF dataset (containing at least one triple term)
+ with a [=Classic=] RDF dataset resulting from the application of `unstar` (and therefore containing an `rdf:unstarMetadata` named graph)
+ would result in a "hybrid" dataset that `unstar` can not process.
+ Such application should make sure to apply `unstar` to every dataset priori to merging them.
+ Since `unstar` is idempotent, there is no harm in applying it more than necessary. We should probably provide the `restar` algorithm, the opposite of `unstar`. The examples in this section are using the Trig concrete syntax [[RDF12-TRIG]]. This section defines additional datatypes that RDF processors MAY support. This section provides transformations between RDF [=Classic=] datasets and RDF [=Full=] datasets,
+ This section provides transformations between RDF [=Classic=] graphs (resp. datasets) and RDF [=Full=] graphs (resp. datasets),
to provide some level of interoperability between the different classes of Conformance.
Should we go even further and aim to provide interoperability between RDF 1.1 and RDF 1.2 [=Full=]? It defines the `unstar` algorithm, which transforms an RDF [=Full=] dataset into an RDF [=Classic=] dataset by encoding all triple-terms into dedicated named graphs.
+ It defines the `unstar` algorithm, which transforms an RDF [=Full=] graph into an RDF [=Classic=] graph by encoding all triple-terms into [=Classic=] triples.
This algorithm is designed to be:
The general principle of the `unstar` algorithm is to replace each triple term `S P O` in the input dataset with a fresh blank node.
- This blank node is then use as the name of a new named graph containing a single triple `S P O`.
- In order to distinguish those new named graphs from the original named graphs of the input dataset,
- dedicated triples are added to a special `rdf:unstarMetadata` named graph. The general principle of the `unstar` algorithm is to replace each triple term `S P O` in the input graph with a fresh blank node.
+ This blank node is then further described with new [=Classic=] triples, repurposing the reification vocabulary.
+ In order to distinguish those new blank nodes from the original blank nodes of the input graph,
+ those blank nodes are assigned a new type `rdf:UnstarredTripleTerm`.
+ The blank nodes generated by `unstar` to replace triple terms should not be confused with the reifiers that are typically associated to these triple terms. The algorithm expects one input variable Dᵢ which is an RDF dataset. It returns a [=Classic=] RDF dataset.
- In the algorithm, we adopt the view presented in .
+ The algorithm expects one input variable Gᵢ which is an RDF graph. It returns a [=Classic=] RDF graph.
The algorithm can be straightforwardly extended to produce a [=Classic=] RDF dataset from any RDF dataset, by applying it recursively to the default graph and to each of the named graphs.
+ This algorithm is responsible for incrementally populating the mapping M and the dataset D used internally by the `unstar` algorithm. It receives a triple term as input and processes it recursively (in case its object is itself a triple term). It returns, among other things, the blank node minted to replace the triple term in the transformed [=Classic=] RDF dataset. This algorithm is responsible for incrementally populating the mapping M and the graph G used internally by the `unstar` algorithm. It receives a triple term as input and processes it recursively (in case its object is itself a triple term). It returns, among other things, the blank node minted to replace the triple term in the transformed [=Classic=] RDF graph. This algorithm expects two input variables:
a triple term t,
and a map Mᵢ from triple terms to blank nodes.
It returns a blank node b,
a map Mₒ from triple terms to blank nodes,
- and a [=Classic=] RDF dataset D.
- In the algorithm, we adopt the view presented in .
+ and a [=Classic=] RDF graph G.
In step 4.3 of this algorithm,
- it is assumed that the blank node b is distinct from any blank node already in use in any dataset at hand,
- in particular the dataset being processed in the invoking `unstar` algorithm.
- Some implementations may require that `unstar` passes that dataset to `quote-triple-term` to ensure this constraint.
+ it is assumed that the blank node b is distinct from any blank node already in use in any graph or dataset at hand,
+ in particular the graph being processed in the invoking `unstar` algorithm.
+ Some implementations may require that `unstar` passes additional information (such as the graph itself, or a list of all blank nodes in use)
+ to `quote-triple-term` to ensure this constraint.
Steps 4.1.1 and 4.2.1 of the `unstar` algorithm exit with an error.
- This will occur if the input dataset contains at the same time triple terms and a graph named `rdf:unstarMetadata`.
- The `unstar` algorithm is therefore not strictly universal as it can not transform this particular kind of datasets.
+ This will occur if the input dataset contains at the same time triple terms and a node of type `rdf:UnstarredTripleTerm`.
+ The `unstar` algorithm is therefore not strictly universal as it can not transform this particular kind of graphs.
This limitation should not be an issue in practice.
- The special graph name `rdf:unstarMapping` is unlikely to be in used in any published dataset,
+ The special type `rdf:UnstarredTripleTerm` is unlikely to be in used in any published dataset,
as it was not defined in the RDF namespace prior to this specification.
For this reason, using it would actually have been bad practice.
- As for future datasets, their authors should consider the graph name `rdf:unstarMetadata` to be reserved, in order to prevent interference with the `unstar` algorithm.
+ As for future datasets, their authors should consider the type `rdf:UnstarredTripleTerm` to be reserved, in order to prevent interference with the `unstar` algorithm.
Another consequence of this restriction is that users should be careful when merging dataset in an application that makes use of the `unstar` algorithm.
- More precisely, merging a [=Full=] RDF dataset (containing at least one triple term)
- with a [=Classic=] RDF dataset resulting from the application of `unstar` (and therefore containing an `rdf:unstarMetadata` named graph)
- would result in a "hybrid" dataset that `unstar` can not process.
- Such application should make sure to apply `unstar` to every dataset priori to merging them.
+ Another consequence of this restriction is that users should be careful when merging graphs in an application that makes use of the `unstar` algorithm.
+ More precisely, merging a [=Full=] RDF graph (containing at least one triple term)
+ with a [=Classic=] RDF graph resulting from the application of `unstar` (and therefore containing a node of type `rdf:UnstarredTripleTerm`)
+ would result in a "hybrid" graph that `unstar` can not process.
+ Such application should make sure to apply `unstar` to every graph prior to merging them.
Since `unstar` is idempotent, there is no harm in applying it more than necessary. The examples in this section are using the Trig concrete syntax [[RDF12-TRIG]]. The examples in this section are using the Turtle concrete syntax [[RDF12-TURTLE]].RDF Documents and Syntaxes
-
@@ -1450,6 +1463,173 @@ Generalizations of RDF Triples, Graphs, and Datasets
+Interoperability between RDF [=Classic=] and RDF [=Full=]
+
+
+
+
+
+ The `unstar` algorithm
+
+
+
+
+
+
+
The `quote-triple-term` algorithm
+
+
+
+
+
+
+
Limitations of the `unstar` algorithm
+
+ Example of applying the `unstar` algorithm
+
+ Additional Datatypes
Generalizations of RDF Triples, Graphs, and Datasets
Interoperability between RDF [=Classic=] and RDF [=Full=]
-
- Interoperability between RDF [=Classic=] and RDF [=Full=]
The `unstar` algorithm
-
-
-
+
+
+
+
The `quote-triple-term` algorithm
-
-
The `quote-triple-term` algorithm
Limitations of the `unstar` algorithm
Limitations of the `unstar` algorithm
Example of applying the `unstar` algorithm
- Limitations of the `unstar` algorithm
Such application should make sure to apply `unstar` to every graph prior to merging them.
Since `unstar` is idempotent, there is no harm in applying it more than necessary.
+ Note that the use of the reification vocabulary does not, in itself, interfere with the `unstar` algorithm, + as long as the subject of the reification triples does not have the type `rdf:UnstarredTripleTerm`. + In particular, a [=Classic=] graph or dataset using "old style" reification will be unchanged by the `unstar` mapping, + and a [=Full=] graph or dataset mixing triple terms with "old style" reification will be losslessly `unstar`red. +
+We should probably provide the `restar` algorithm, the opposite of `unstar`.
From ec44491f05c40148870e155759b6ef9872d85671 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine ChampinShould we go even further and aim to provide interoperability between RDF 1.1 and RDF 1.2 [=Full=]?
-It defines the `unstar` algorithm, which transforms an RDF [=Full=] graph into an RDF [=Classic=] graph by encoding all triple-terms into [=Classic=] triples. +
It defines the `classicize` algorithm, which transforms an RDF [=Full=] graph into an RDF [=Classic=] graph by encoding all triple-terms into [=Classic=] triples. This algorithm is designed to be:
@@ -1486,24 +1486,22 @@The general principle of the `unstar` algorithm is to replace each triple term `S P O` in the input graph with a fresh blank node. +
The general principle of the `classicize` algorithm is to replace each triple term `S P O` in the input graph with a fresh blank node. This blank node is then further described with new [=Classic=] triples, repurposing the reification vocabulary. In order to distinguish those new blank nodes from the original blank nodes of the input graph, - those blank nodes are assigned a new type `rdf:UnstarredTripleTerm`. + those blank nodes are assigned a new type `rdf:ClassicizedTripleTerm`.
-The blank nodes generated by `unstar` to replace triple terms should not be confused with the reifiers that are typically associated to these triple terms.
+The blank nodes generated by `classicize` to replace triple terms should not be confused with the reifiers that are typically associated to these triple terms.
-Despite having the same name, the `unstar` mapping defined in this specification is different from the `unstar` mapping defined in [[RDF-STAR-CG]].
- -The algorithm expects one input variable Gᵢ which is an RDF graph. It returns a [=Classic=] RDF graph.
@@ -1513,14 +1511,14 @@This algorithm is responsible for incrementally populating the mapping M and the graph G used internally by the `unstar` algorithm. It receives a triple term as input and processes it recursively (in case its object is itself a triple term). It returns, among other things, the blank node minted to replace the triple term in the transformed [=Classic=] RDF graph.
+This algorithm is responsible for incrementally populating the mapping M and the graph G used internally by the `classicize` algorithm. It receives a triple term as input and processes it recursively (in case its object is itself a triple term). It returns, among other things, the blank node minted to replace the triple term in the transformed [=Classic=] RDF graph.
This algorithm expects two input variables: a triple term t, @@ -1554,14 +1552,14 @@
In step 4.3 of this algorithm, it is assumed that the blank node b is distinct from any blank node already in use in any graph or dataset at hand, - in particular the graph being processed in the invoking `unstar` algorithm. - Some implementations may require that `unstar` passes additional information (such as the graph itself, or a list of all blank nodes in use) - to `quote-triple-term` to ensure this constraint. + in particular the graph being processed in the invoking `classicize` algorithm. + Some implementations may require that `classicize` passes additional information (such as the graph itself, or a list of all blank nodes in use) + to `classicize-triple-term` to ensure this constraint.
Steps 4.1.1 and 4.2.1 of the `unstar` algorithm exit with an error. - This will occur if the input dataset contains at the same time triple terms and a node of type `rdf:UnstarredTripleTerm`. - The `unstar` algorithm is therefore not strictly universal as it can not transform this particular kind of graphs. +
Steps 4.1.1 and 4.2.1 of the `classicize` algorithm exit with an error. + This will occur if the input dataset contains at the same time triple terms and a node of type `rdf:ClassicizedTripleTerm`. + The `classicize` algorithm is therefore not strictly universal as it can not transform this particular kind of graphs.
This limitation should not be an issue in practice. - The special type `rdf:UnstarredTripleTerm` is unlikely to be in used in any published dataset, + The special type `rdf:ClassicizedTripleTerm` is unlikely to be in used in any published dataset, as it was not defined in the RDF namespace prior to this specification. For this reason, using it would actually have been bad practice. - As for future datasets, their authors should consider the type `rdf:UnstarredTripleTerm` to be reserved, in order to prevent interference with the `unstar` algorithm. + As for future datasets, their authors should consider the type `rdf:ClassicizedTripleTerm` to be reserved, in order to prevent interference with the `classicize` algorithm.
-Another consequence of this restriction is that users should be careful when merging graphs in an application that makes use of the `unstar` algorithm. +
Another consequence of this restriction is that users should be careful when merging graphs in an application that makes use of the `classicize` algorithm. More precisely, merging a [=Full=] RDF graph (containing at least one triple term) - with a [=Classic=] RDF graph resulting from the application of `unstar` (and therefore containing a node of type `rdf:UnstarredTripleTerm`) - would result in a "hybrid" graph that `unstar` can not process. - Such application should make sure to apply `unstar` to every graph prior to merging them. - Since `unstar` is idempotent, there is no harm in applying it more than necessary.
+ with a [=Classic=] RDF graph resulting from the application of `classicize` (and therefore containing a node of type `rdf:ClassicizedTripleTerm`) + would result in a "hybrid" graph that `classicize` can not process. + Such application should make sure to apply `classicize` to every graph prior to merging them. + Since `classicize` is idempotent, there is no harm in applying it more than necessary.- Note that the use of the reification vocabulary does not, in itself, interfere with the `unstar` algorithm, - as long as the subject of the reification triples does not have the type `rdf:UnstarredTripleTerm`. - In particular, a [=Classic=] graph or dataset using "old style" reification will be unchanged by the `unstar` mapping, - and a [=Full=] graph or dataset mixing triple terms with "old style" reification will be losslessly `unstar`red. + Note that the use of the reification vocabulary does not, in itself, interfere with the `classicize` algorithm, + as long as the subject of the reification triples does not have the type `rdf:ClassicizedTripleTerm`. + In particular, a [=Classic=] graph or dataset using "old style" reification will be unchanged by the `classicize` mapping, + and a [=Full=] graph or dataset mixing triple terms with "old style" reification will be losslessly `classicize`d.
We should probably provide the `restar` algorithm, the opposite of `unstar`.
+We should maybe provide the reverse algorithm of `classicize`.
-The examples in this section are using the Turtle concrete syntax [[RDF12-TURTLE]].
- - - From 10065ac7bdbcd64bce34c0dd5d92a72db058bc9f Mon Sep 17 00:00:00 2001 From: Pierre-Antoine ChampinThe general principle of the `classicize` algorithm is to replace each triple term `S P O` in the input graph with a fresh blank node. - This blank node is then further described with new [=Classic=] triples, repurposing the reification vocabulary. + This blank node is then further described with new [=Classic=] triples, using a new dedicated vocabulary in the namespace `https://www.w3.org/ns/rdf-classicize#`, which in the following will be mapped to the prefix `classicize:`. In order to distinguish those new blank nodes from the original blank nodes of the input graph, - those blank nodes are assigned a new type `rdf:ClassicizedTripleTerm`. + those blank nodes are assigned a new type `classicize:TripleTerm`.
The blank nodes generated by `classicize` to replace triple terms should not be confused with the reifiers that are typically associated to these triple terms.
@@ -1511,7 +1511,7 @@Steps 4.1.1 and 4.2.1 of the `classicize` algorithm exit with an error. - This will occur if the input dataset contains at the same time triple terms and a node of type `rdf:ClassicizedTripleTerm`. + This will occur if the input dataset contains at the same time triple terms and a node of type `classicize:TripleTerm`. The `classicize` algorithm is therefore not strictly universal as it can not transform this particular kind of graphs.
This limitation should not be an issue in practice. - The special type `rdf:ClassicizedTripleTerm` is unlikely to be in used in any published dataset, - as it was not defined in the RDF namespace prior to this specification. + The `classicize:` namespace is unlikely to be in used in any published dataset, + as it was not defined prior to this specification. For this reason, using it would actually have been bad practice. - As for future datasets, their authors should consider the type `rdf:ClassicizedTripleTerm` to be reserved, in order to prevent interference with the `classicize` algorithm. + As for future datasets, their authors should consider the `classicize:` namespace to be reserved, in order to prevent interference with the `classicize` algorithm.
Another consequence of this restriction is that users should be careful when merging graphs in an application that makes use of the `classicize` algorithm. More precisely, merging a [=Full=] RDF graph (containing at least one triple term) - with a [=Classic=] RDF graph resulting from the application of `classicize` (and therefore containing a node of type `rdf:ClassicizedTripleTerm`) + with a [=Classic=] RDF graph resulting from the application of `classicize` (and therefore using the `classicize:` vocabulary) would result in a "hybrid" graph that `classicize` can not process. Such application should make sure to apply `classicize` to every graph prior to merging them. Since `classicize` is idempotent, there is no harm in applying it more than necessary.
- -- Note that the use of the reification vocabulary does not, in itself, interfere with the `classicize` algorithm, - as long as the subject of the reification triples does not have the type `rdf:ClassicizedTripleTerm`. - In particular, a [=Classic=] graph or dataset using "old style" reification will be unchanged by the `classicize` mapping, - and a [=Full=] graph or dataset mixing triple terms with "old style" reification will be losslessly `classicize`d. -
-We should maybe provide the reverse algorithm of `classicize`.
From 91bff0f2c247a6b013bacb109d149895e8d37444 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Champin