TEMPLATE DESIGN © 2007
www.PosterPresentations.com
Representing and Querying Negative Knowledge in RDF
Fariz Darari
Free University of Bozen-Bolzano, Italy
fadirra@gmail.com
Overview
Typically, only positive data can be represented in RDF. However,
negative knowledge representation is required in some application
domains such as food allergies, software incompatibility and
school absence. We present an approach to represent and query
RDF data with negative knowledge. We provide the syntax,
semantics and an example. We argue that this approach fits into
the open-world semantics of RDF according to the notion of
certain answers.
Syntax
• Negative RDF data are represented abstractly by:
not(s, p, o)
• Practical implementation by using reification with types
:posStatement and :negStatement
• Inconsistency occurs when:
The intersection between positive and negative RDF data
is not empty.
• As for querying, there will be a preprocessing step to de-
reify positive and negative RDF data and put them into the
graphs :posGraph and :negGraph, respectively.
• SPARQL queries can contain negative triple patterns.
Semantics
• Simple Interpretation I of a vocabulary V is defined by (W3C):
1. A non-empty set IR of resources, called the universe of I.
2. A set IP, called the set of properties of I.
3. A mapping IEXT from IP into the powerset IR x IR.
• Semantics of positive RDF data (W3C):
If E is a ground positive triple (s, p, o), then I(E) = true if s, p and o
are in V, I(p) is in IP and <I(s), I(o)> is in IEXT(I(p)),
otherwise I(E)= false.
• Semantics of negative RDF data:
If E is a ground negative triple not(s, p, o), then I(E) = true if s, p
and o are in V, I(p) is in IP and <I(s), I(o)> is not in IEXT(I(p)),
otherwise I(E)= false.
• Semantics of SPARQL Queries
During evaluation, all positive triple patterns in the body of queries
will be delegated into positive graph :posGraph, whereas all
negative triple patterns will be delegated into negative graph
:negGraph using GRAPH graph patterns.
• Theorem
For a SPARQL query Q with positive and negative triple patterns
and a consistent RDF data D, the evaluation of query Q over D
gives certain answers over all models of D.
Motivating Scenario: Food Allergies
Let D be the following RDF data:
{(john, eats, egg), (john, eats, nut),
(tom, eats, egg), not(john, eats, fish)}
Let Q be the following query:
SELECT {?x} {(?x, eats, egg), not(?x, eats, fish)}
Evaluating Q to D gives us: {{?x/john}}
Observe that in the implementation, for example, the
negative triple not(john, eats, fish) will be
represented using reification as:
_:t1
:john
:negStatement
:eats
:fish
:subj
:pred
:obj
After dereification, the triple :john :eats :fish is
stored in the graph :negGraph.
The query Q during evaluation has the following form:
SELECT ?x WHERE {GRAPH :posGraph {?x :eats :egg}
GRAPH :negGraph {?x :eats :fish}}
Future Work
What if:
• Blank nodes were included?
• RDFS schema were considered?
• More expressive SPARQL queries were used?
Reference
M. Arenas, C. Gutierrez, J. Pérez, On the Semantics of SPARQL In:
Semantic Web Information Management: A Model Based
Perspective, Springer, 2010 (ISBN: 978-3-642-04328-4)
Acknowledgment
The author was supported by the European Master's Program in
Computational Logic (EMCL) and the project Querying Incomplete
Data (QUID) funded by the FU Bozen-Bolzano.

ESWC 2013 Poster: Representing and Querying Negative Knowledge in RDF

  • 1.
    TEMPLATE DESIGN ©2007 www.PosterPresentations.com Representing and Querying Negative Knowledge in RDF Fariz Darari Free University of Bozen-Bolzano, Italy [email protected] Overview Typically, only positive data can be represented in RDF. However, negative knowledge representation is required in some application domains such as food allergies, software incompatibility and school absence. We present an approach to represent and query RDF data with negative knowledge. We provide the syntax, semantics and an example. We argue that this approach fits into the open-world semantics of RDF according to the notion of certain answers. Syntax • Negative RDF data are represented abstractly by: not(s, p, o) • Practical implementation by using reification with types :posStatement and :negStatement • Inconsistency occurs when: The intersection between positive and negative RDF data is not empty. • As for querying, there will be a preprocessing step to de- reify positive and negative RDF data and put them into the graphs :posGraph and :negGraph, respectively. • SPARQL queries can contain negative triple patterns. Semantics • Simple Interpretation I of a vocabulary V is defined by (W3C): 1. A non-empty set IR of resources, called the universe of I. 2. A set IP, called the set of properties of I. 3. A mapping IEXT from IP into the powerset IR x IR. • Semantics of positive RDF data (W3C): If E is a ground positive triple (s, p, o), then I(E) = true if s, p and o are in V, I(p) is in IP and <I(s), I(o)> is in IEXT(I(p)), otherwise I(E)= false. • Semantics of negative RDF data: If E is a ground negative triple not(s, p, o), then I(E) = true if s, p and o are in V, I(p) is in IP and <I(s), I(o)> is not in IEXT(I(p)), otherwise I(E)= false. • Semantics of SPARQL Queries During evaluation, all positive triple patterns in the body of queries will be delegated into positive graph :posGraph, whereas all negative triple patterns will be delegated into negative graph :negGraph using GRAPH graph patterns. • Theorem For a SPARQL query Q with positive and negative triple patterns and a consistent RDF data D, the evaluation of query Q over D gives certain answers over all models of D. Motivating Scenario: Food Allergies Let D be the following RDF data: {(john, eats, egg), (john, eats, nut), (tom, eats, egg), not(john, eats, fish)} Let Q be the following query: SELECT {?x} {(?x, eats, egg), not(?x, eats, fish)} Evaluating Q to D gives us: {{?x/john}} Observe that in the implementation, for example, the negative triple not(john, eats, fish) will be represented using reification as: _:t1 :john :negStatement :eats :fish :subj :pred :obj After dereification, the triple :john :eats :fish is stored in the graph :negGraph. The query Q during evaluation has the following form: SELECT ?x WHERE {GRAPH :posGraph {?x :eats :egg} GRAPH :negGraph {?x :eats :fish}} Future Work What if: • Blank nodes were included? • RDFS schema were considered? • More expressive SPARQL queries were used? Reference M. Arenas, C. Gutierrez, J. Pérez, On the Semantics of SPARQL In: Semantic Web Information Management: A Model Based Perspective, Springer, 2010 (ISBN: 978-3-642-04328-4) Acknowledgment The author was supported by the European Master's Program in Computational Logic (EMCL) and the project Querying Incomplete Data (QUID) funded by the FU Bozen-Bolzano.