Reputation: 143825
Could anybody be so kind to give me a simple example of reification in RDF? I want to see if I understood it correctly.
For example, I propose the following case
Tolkien -> wrote -> Lord of the rings
/|\
|
Wikipedia said that
How would you write it with and without reification (i.e. as a simple RDF statement with no need for reification)?
Upvotes: 29
Views: 16151
Reputation: 10188
"Tolkien wrote Lord of the Rings" can be expressed as a simple statement (subject, predicate, object) like this:
:Tolkien :wrote :LordOfTheRings .
By the way, this is using the Turtle notation for RDF. There are tools online for converting it to RDF/XML.
Using reification, you can have a separate resource representing a statement so you can state additional things about the statement itself, like "Wikipedia said that":
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:x rdf:type rdf:Statement .
_:x rdf:subject :Tolkien .
_:x rdf:predicate :wrote .
_:x rdf:object :LordOfTheRings .
_:x :said :Wikipedia .
In real life, you would want to use shared vocabularies, so that whoever or whatever is consuming the RDF will know that you are talking about that Tolkien and that LOTR:
http://dbpedia.org/resource/The_Lord_of_the_Rings
http://dbpedia.org/property/author
http://dbpedia.org/resource/dbppedia/J._R._R._Tolkien
Upvotes: 40
Reputation: 111
As of 2020 you can use RDF* as follows:
<< :Tolkien :wrote :LordOfTheRings >> :said :Wikipedia .
In 2020 many leading triple stores implemented this approach. There are also tools to convert standard reification to RDF* to reduce triple bloat. This approach is efficient in terms of the number of triples and the speed to load data, as reported by Ontotext’s GraphDB Triple store as well as several others.
You can read about the origins of this approach here https://arxiv.org/pdf/1406.3399.pdf
Upvotes: 8
Reputation: 81
Unfortunately, up to now, relationship instances, that is, what the W3C documents call elements of the extension of the relation, or what in mathematics you would call the pairs, that are the elements of the relation, are not considered to be first class citizens.
The semantic web ecosystem claims the AAA slogan, that anybody can say anything about anything. But this is not true, if the first "anything" here is a single edge of the graph. Even, if RDF itself has the means to express knowledge about a single edge, the W3C RDF semantics document does its best, not to support this expressivity.
Basically, there are 4 approaches to say something about an edge:
Property singletons are definitely the simplest solution to the problem, since they don't add anything -- you are just avoiding to make the mistake to [re]use a class-level property identifier for instance edges over and over again. Other modelling ecosystems, which have a clear understanding of meta-modelling (MOF eg.), are much less tempted to make such a mistake. Class-level edges connect class-level nodes and instance-level edges connect instance-level nodes. That's it.
If you do this right (as Vinh and his colleagues propose it), you are on the conflict road wrt reasoners, which are hard-coded along the W3C RDF semantics document.
You can circumvent this temporarily (as long as the W3C has not yet standardised property singletons) by making another design flaw and implement your property singletons as subPropertyOf-s of the class-level property [instead of making them instances of it]. Then a present RDFS reasoner would conclude from a
:my_label_0815 rdfs:subPropertyOf rdfs:label .
:some_node :my_label_0815 "some_string" .
that
:some_node rdfs:label "some_string" .
This is a dirty work-around, since it breaks clear separation of meta-levels.
We have such a lot of terribly designed models out there, just because, we don't have a straightforward way to say something about references (instance-level edges).
Upvotes: 8
Reputation: 119
A better way of doing it, is to use the singleton property approach.
For example, you create a singleton property to represent this statement as:
Tolkien wrote#1 "Lord of the rings" .
wrote#1 rdf:singletonPropertyOf wrote .
wrote#1 asserted_by Wikipedia .
You may want to read more about it in the paper "Don't like RDF Reification? Making statements about statements using singleton property" or its slides at http://www.slideshare.net/ntkimvinh7/www2014-singleton-propertyfinal...
Upvotes: 7