Databases Reference
In-Depth Information
Query 4
SELECT ?X
WHERE { { ?X a foaf:Agent } UNION
{ ?X a foaf:Person } UNION
{ ?X a foaf:Organization } UNION
{ ?X foaf:made ?Y } }
♦
With this small example, we have shown that the rewriting technique for
OWL 2 QL can be partially applied to SPARQL queries. However, note that
OWL 2 QL (and likewise the respective query rewriting algorithms from the
DL literature) omit important OWL features for Linked Data (discussed later
as mentioned in the following section might be more suitable.
Rule-Based Reasoning.
As an alternative to query rewriting based on the
OWL 2 QL profile, another fragment of OWL - OWL 2 RL [25, Section 4] -
has a normative set of rules called OWL 2 RL/RDF, which encode a subset of
the semantics of RDFS and OWL 2 and can be directly used for (Datalog-style)
reasoning (see also the informal RDFS entailment rules in [35, Section 7], which
were later extended by OWL features in [65,53]).
Some sample OWL 2 RL/RDF rules are given in Table 3 implementing the
basic features of RDFS and additionally supporting the semantics of equality
OWL features (and respective rules encoding these) are particularly relevant for
Linked Data Reasoning will be discussed in Section 4.
Tabl e 3.
Core RDFS and
owl:sameAs
rules
ID
Head
Body
prp-spo1 (?
s,
?
p
2
,
?
o
)
←
(?
p
1
,
rdfs:subPropertyOf
,
?
p
2
)
,
(?
s,
?
p
1
,
?
o
)
prp-dom (?
p,
rdf:type
,
?
c
)
←
(?
p,
rdfs:domain
,
?
c
)
,
(?
s,
?
p,
?
o
)
prp-rng (?
o,
rdf:type
,
?
c
)
←
(?
p,
rdfs:range
,
?
c
)
,
(?
s,
?
p,
?
o
)
cax-sco (?
s,
rdf:type
,
?
c
2
)
←
(?
c
1
,
rdfs:subClassOf
,
?
c
2
)
,
(?
s,
rdf:type
,
?
c
1
)
eq-sym (?
y,
owl:sameAs
,
?
x
)
←
(?
x,
owl:sameAs
,
?
y
)
eq-trans (?
x,
owl:sameAs
,
?
z
)
←
(?
x,
owl:sameAs
,
?
y
)
,
(?
y,
owl:sameAs
,
?
z
)
eq-rep-s (?
s
,
?
p,
?
o
)
(?
s,
owl:sameAs
,
?
s
)
,
(?
s,
?
p,
?
o
)
←
eq-rep-p (?
s,
?
p
,
?
o
)
(?
p,
owl:sameAs
,
?
p
)
,
(?
s,
?
p,
?
o
)
←
eq-rep-o (?
s,
?
p,
?
o
)
(?
o,
owl:sameAs
,
?
o
)
,
(?
s,
?
p,
?
o
)
←
As opposed to query-rewriting (top-down evaluation), OWL 2 RL/RDF rules
can also be applied in a bottom-up fashion for the purposes of a priori
materiali-
sation
: given a linked dataset
Γ
and a set of such inference rules
R
, pre-compute