I just read about the concept of entailment for RDF (Resource Description Framework).Can anyone tell me an example of entailment for two RDF graphs and explain them a bit.
Thanks
I just read about the concept of entailment for RDF (Resource Description Framework).Can anyone tell me an example of entailment for two RDF graphs and explain them a bit.
Thanks
Suppose you have the following :
So a Sparql query like SELECT ?s { ?s rdf:type ex:Publication } will return only ex:book1
If you add the fact (or a graph in your data set with the fact) that states :
If your sparql engine processes entailments, it should deduce that a ex:Article is also a ex:Publication
so SELECT ?s { ?s rdf:type ex:Publication } would return both ex:book1 AND ex:book2
PS: for more information, the example comes from http://www.w3.org/TR/2009/WD-sparql11-entailment-20091022/
There's another answer about RDFS entailment, which is important, and a valuable part of day-to-day work with RDF, but RDFS entailment is not the same as RDF entailment. RDF entailment is a relationship between entire RDF graphs, and gives a way of saying "If RDF graph x holds, then so does RDF graph y." The simple entailment section of the RDF Semantics documents describes basic entailment:
This presumes an understanding of the interpretation of graph E, denoted I(E). An interpretation maps each property to a set of pairs. E.g., an interpretation should map the property
rdfs:subClassOf
to the set of pairs {[x, y] : x is a subclass of y}. For an interpretation to satisfy a graph, then the set of pairs that an interpretation maps a property to must contain at least those pairs that are actually observed in the graph. For instance, if the graph containsthen an interpretation satisfies the graph if and only if I(likes) contains the pairs [a,b] and [b,c]. A graph G1 entails graph G2 if and only if every interpretation that satisfies G1 also satisfies G2. If there are no blank nodes in the graph, this is pretty simple.
The linked section from the RDF Semantics document lists some simple results of this:
Things get more complicated when there are blank nodes in an RDF graph, because blank nodes are interpreted as existential variables. For instance, consider the graph with just one triple (where
_:z
is a blank node):Since
_:z
is an existential variable, this means that an interpretation satisfies the graph if and only if there exists an individual x such that the interpretation of likes contains a pair [a,x]. If a graph has blank nodes, then replacing those blank nodes with actual terms produces an instance of that graph. For instance,is an instance of the graph
The linked document also mentions the entailment relation that
This is easy to see: if an interpretation satisfies
a likes b
, then its interpretation of likes must contain [a,b], so there certainly is an x (namely b) such that it contains [a,x], so it also satisfiesa likes _:z
.These are just a few simple examples of RDF graph entailment. I don't know that this type of entailment actually gets used much in day-to-day work with RDF. Much more common is RDFS-entailment (described in another answer), OWL entailment, and rule-based reasoning.