Take the 2-minute tour ×

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.


share|improve this question
add comment

2 Answers

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:

Following conventional terminology, I satisfies E if I(E)=true, and a set S of RDF graphs (simply) entails a graph E if every interpretation which satisfies every member of S also satisfies E. In later sections these notions will be adapted to other classes of interpretations, but throughout this section 'entailment' should be interpreted as meaning simple 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 contains

a likes b.
b likes c.

then 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:

  • Every graph entails the empty graph.
  • Every graph entails each of its subgraphs.

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

a likes _:z

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,

a likes b

is an instance of the graph

a likes _:z

The linked document also mentions the entailment relation that

  • Every instance of a graph entails the graph

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

share|improve this answer
add comment

Suppose you have the following :

ex:book1 rdf:type ex:Publication . 
ex:book2 rdf:type ex:Article .

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 :

ex:Article rdfs:subClassOf ex:Publication

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/

share|improve this answer
I edited the answer to add the w3c resource about the example (and much more... ;) –  Max May 15 '13 at 15:04
This is an example of RDFS entailment. There are some inference rules that say "From 'A implies B' and 'A', infer 'B'." In RDFS, there are rules that say "From 'A rdfs:subClassOf B' and 'x is an A', infer 'x is a B'." This is important, but not the same as RDF entailment. RDF entailment doesn't require RDFS, and covers different kinds of entailment between graphs. –  Joshua Taylor May 15 '13 at 15:16
thanks for the correction Joshua, seems I was focused on the entailment part and skipped the between parts graph :P –  Max May 15 '13 at 15:30
No worries, I read it in exactly the same way at first. I added an answer about RDF entailment, but ended it with the caveat that I think RDFS (and OWL, and rule-based) entailment is much more important for most RDF-users' day-to-day work. –  Joshua Taylor May 15 '13 at 15:37
thankyou for your reply ! but as Joshu said i want an example for rdf entailment between graph =S –  Anum Lodhi May 16 '13 at 11:54
add comment

Your Answer


