Simple example of reification in RDF

↘锁芯ラ 提交于 2019-12-17 17:44:40

问题


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)?


回答1:


"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




回答2:


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




回答3:


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:

  • the unpopular, bloating loosely coupled RDF statements
  • property singletons
  • single statement named graphs (4th element in a quad being a graph ID)
  • association nodes (analoguously to UML association classes)

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).



来源:https://stackoverflow.com/questions/1312741/simple-example-of-reification-in-rdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!