Introducing Wild-card and Negation for Optimizing SPARQL Queries
based on Rewriting RDF Graph and SPARQL Queries
Faisal Alkhateeb
Department of Computer Science, Jordan University of Science and Technology, Irbid, 22110, Jordan
Department of Computer Science, Yarmouk University, Irbid, 21163, Jordan
Keywords:
RDF, SPARQL, Negation, Wild-card, Querying RDF and RDFS Graphs, Query Optimization.
Abstract:
In this paper, we extend the SPARQL triple patterns to include two operators (the negation and the wild-card).
We define the syntax and the semantics of these operators, in particular, when using them in the predicate
position of SPARQL triple patterns. The use of the negation and wild-card operators and thus the semantics are
different from the literature. Then, we show that these two operators could be used to enhance the evaluation
performance of some SPARQL queries and to add extra expressiveness.
1 INTRODUCTION
RDF (Resource Description Framework (Manola and
Miller, 2004)) is the most used language for the rep-
resentation of knowledge and the description of doc-
uments within the semantic web.
SPARQL is the standard query language for RDF
recommended by the W3C (Prud’hommeaux and
Seaborne, 2008). SPARQL allows the use of nega-
tion operator in the Filter constraints (i.e., it is re-
stricted to syntactic matching using predefined func-
tions and thus applying post filtering). An exten-
sion of SPARQL, called PSPARQL have been devel-
oped in (Alkhateeb et al., 2009). It adds path ex-
pressions to SPARQL. The negation operator is ini-
tially introduced in the syntax of path expressions
of PSPARQL (see some examples and discussions
in (Alkhateeb, 2008)) for querying RDF but with-
out defining its semantics. It is shown in (Alkhateeb
et al., 2008) that answering SPARQL queries modulo
RDF Schema could be achieved by transforming them
into PSPARQL queries. Later on it is used in other
path expressions (such as (Zauner et al., 2010; Fionda
et al., 2015) and SPARQL 1.1 (Harris and Seaborne,
2013)) without entailment (Glimm and Ogbuji, 2013),
i.e., syntactic matching of path expressions over prop-
erty paths of URIs.
The wild-card is introduced in path query lan-
guages (Alechina et al., 2003) for querying semi-
structured data that replaces a whole predicate. To our
knowledge, there is no RDF query language that uses
wild-card, in particular, to replace a fragment part of a
predicate URI (i.e., matching all predicates defined in
the same namespace or URI prefix). In addition, the
use of wild-card operator can be implemented using
the fn:strstarts using FILTER constraints. How-
ever, it is better to evaluate constraints on the fly and
not as a post processing phase as shown in (Alkha-
teeb, 2008).
Moreover, none of these languages use the two op-
erators (the negation and the wild-card) in combina-
tion with each other and thus the semantics is not de-
fined for the combination.
The contributions in this paper are: the use of
these two operators in a different way than that in
the literature; the definition of their semantics and a
method for answering queries containing them over
RDF graphs; and their exploitation for optimizing
queries over RDF and RDFS graphs.
Paper Outline. The remainder of the paper is or-
ganized as follows. In Section 2, we introduce the
RDF language and the SPARQL language. The pro-
posed extension is presented in Section 3. We pro-
pose an approach for optimizing the evaluation of
queries over RDF graphs considering RDFS seman-
tics in Section 4.1. Finally, we conclude in Section 5.
2 PRELIMINARIES
2.1 RDF
RDF graphs are constructed over sets of URI refer-
ences (or urirefs), blanks, and literals (Carroll and
Klyne, 2004). The union of these three sets are called
Alkhateeb, F.
Introducing Wild-card and Negation for Optimizing SPARQL Queries based on Rewriting RDF Graph and SPARQL Queries.
In Proceedings of the 12th International Conference on Web Information Systems and Technologies (WEBIST 2016) - Volume 2, pages 181-187
ISBN: 978-989-758-186-1
Copyright
c
2016 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
181
c
1
c
2
c
3
c
4
airfrance:flight1
tgv
plane
tag
train
transport
bus
sp
sp
sp
sp
sp
sp
G
S
Figure 1: An RDF graph (G) with its schema representing information about transportation means between several cities.
the RDF terminology.
Terminology. An RDF terminology, noted T , is the
union of 3 pairwise disjoint infinite sets of terms: the
set U of urirefs, the set L of literals and the set B of
blanks. The vocabulary V denotes the set of names,
i.e., V = U L. We use the following notations for
the elements of these sets: a blank will be prefixed
by :, a literal will be expressed between quotation
marks, remaining elements will be urirefs.
This terminology grounds the definition of RDF
graphs.
Definition 1 (RDF graph). An RDF triple is an ele-
ment of U × U × (U L ). An RDF graph is a set of
RDF triples.
For simplicity and without loss of generality, we
do not consider blank nodes in the above definition
of RDF graphs since they could simply be treated as
constants (as if they were URIs) without considering
their existential semantics.
Example 1 (RDF graph). RDF can be used for
representing information about cities, transportation
means between cities, and relationships between the
transportation means (see Figure 1).
For instance, a triple hb, plane, ci means that
there exists a transportation mean plane from b to c.
From now, in a triple t = hb, plane, ci, b is called
the subject, plane is the predicate and c is the object
of the triple t. Also, htgv sp traini means that tgv
is a sub-property of train.
2.2 SPARQL
For a complete description of SPARQL, the
reader is referred to the SPARQL specification
(Prud’hommeaux and Seaborne, 2008) or to (P
´
erez
et al., 2009; Polleres, 2007) for its formal semantics.
2.2.1 SPARQL Syntax
The basic building blocks of SPARQL queries are
graph patterns which are shared by all SPARQL
query forms. Informally, a graph pattern can be a
triple pattern, a basic graph pattern (i.e., a set of triple
patterns), a union of graph patterns, an optional graph
pattern, or a constraint. Let X be the set of variables.
Definition 2 (SPARQL Triple Pattern). A SPARQL
triple pattern is a set of triples of (U X )×(U X )×
(U L X ).
In the following, a variable will be prefixed by ?
(like ?C
1
).
Example 2 (SPARQL Triple Pattern). The following
is a SPARQL triple pattern:
h?city1 train ?city2i
that could be used to retrieve pairs of cities con-
nected by a train relation.
Definition 3 (SPARQL Graph Pattern). A SPARQL
graph pattern is defined inductively in the following
way:
every SPARQL triple pattern is a SPARQL graph
pattern;
if P, P
0
are SPARQL graph patterns and K is a
SPARQL constraint, then (P AND P
0
), (P UNION
P
0
), (P OPT P
0
), and (P FILTER K) are SPARQL
graph patterns.
A SPARQL constraint K is a boolean expres-
sion involving terms from (V X ), e.g., a numeric
test. We do not specify these expressions further (see
(Mu
˜
noz et al., 2009) for a more complete treatment).
Example 3 (SPARQL Graph Pattern). The following
SPARQL graph pattern:
{
?city1 ?p ?city2 .
Filter (NOT (regex(?p, "bus")))
}
could be used to retrieve pairs of cities connected
by any relation that is not a bus. Note that the nega-
tion operator is used in the above query in the Filter
constraint for post-filtering the values of ?p after find-
ing all matches of ?p in the triple pattern.
2.2.2 SPARQL Semantics
In the following, we characterize SPARQL query an-
swering using maps. More precisely, we use SPARQL
queries restricted to conjunction of triple patterns and
SPARQL FILTER constraints and the reader may
WEBIST 2016 - 12th International Conference on Web Information Systems and Technologies
182
refer to (P
´
erez et al., 2006a) for other compound
SPARQL graph patterns).
Definition 4 (Map). Let V
1
(T X ), and V
2
T
be two sets of terms. A map from V
1
to V
2
is a function
µ : V
1
V
2
such that x (V
1
V ), µ(x) = x.
If µ is a map, then the domain of µ, denoted by
dom(µ), is the subset of X on which µ is defined.
The restriction of µ to a set of terms X is defined by
µ|
X
= {hx,yi µ| x X}. If P is a SPARQL graph pat-
tern, then we use X (P) to denote the set of variables
occurring in P and µ(P) to denote the graph pattern
obtained by the substitution of µ(b) to each variable
b X (P).
Definition 5 (Answers to SPARQL Triple Pattern).
Let P be a SPARQL triple pattern, K be a SPARQL
constraint, and G be an RDF graph. The set S (P,G)
of answers to P in G is defined in the following way:
S (P,G) = {µ|
X (P)
| µ(P) G}
S (P FILTER K, G) = {µ S (P, G) | µ(K) = >}
3 EXTENDED SPARQL TRIPLE
PATTERNS
In this section, we define the syntax and the seman-
tics of an extension to SPARQL triple patterns. The
proposed extension includes two new operators (wild-
card and negation) used in the predicate position of
triple patterns.
3.1 Extended SPARQL Triple Patterns
Syntax
SPARQL allows to use only variables or urirefs in the
predicate position of triple patterns. In the proposed
extension, the negation operator, the wild-card opera-
tor, or a combination of both of them could be used in
the predicate position. In the following, we define all
possible predicate expressions.
Definition 6 (Predicate Expression). The set of pred-
icate expressions (denoted by E) is defined by:
if a U then a E , !a E, a:# E , !(a:#) E.
if x X , then x E .
Where # is the wild-card
1
operator and ! is the nega-
tion operator.
Definition 7 (Extended SPARQL Triple Pattern). An
Extended SPARQL triple pattern is a set of triples of
(U X ) × E × (U L X ).
1
Note that the symbol ? could be used in place of the
symbol #.
It should be noticed that the negation operator
is initially introduced in the syntax of PSPARQL
(Alkhateeb, 2008) for querying RDF but without
defining its semantics. It is also used in other path
expressions (such as RPL (Zauner et al., 2010) and
SPARQL 1.1 (Harris and Seaborne, 2013)) without
entailment (Glimm and Ogbuji, 2013).
The wild-card is introduced in (Alechina et al.,
2003) for querying semi-structured data that replaces
a whole predicate. SPARQL 1.1 allows the use of
elt? in path expressions to match a path that con-
nects a subject and object of the path by zero or one
matches of elt. To our knowledge, there is no RDF
query language that uses wild-card, in particular, to
replace a fragment of a predicate (as illustrated in the
following examples). Moreover, none of these lan-
guages use the two operators (the negation and the
wild-card) in combination with each other and thus
the semantics is not defined for the combination.
Example 4 (Extended SPARQL Triple Pattern). The
following extended SPARQL triple:
h?city1 airfrance:# ?city2i
could be basically used to retrieve all pairs of
cities connected by any property that belongs to
the airfrance. Contrary, the following extended
SPARQL triple could be used to retrieve all pairs of
cities connected by any property that does not belong
to the airfrance:
h?city1 !(airfrance:#) ?city2i
3.2 Extended SPARQL Triple Patterns
Semantics
The semantics of a predicate expression E in an RDF
graph G is defined by a set of pairs of terms in G sat-
isfying E.
Definition 8 (Extended Semantics: Simple). Given
a predicate expression E E and an RDF graph G,
then the semantics of E (denoted by [[E]]
G
) in G is
defined as:
[[!a]]
G
= {hx,yi| hx,b, yi G b 6= a}
[[a : #]]
G
= {hx,yi| hx,b, yi G a b}
[[!a : #]]
G
= {hx,yi| hx,b, yi G a b}
where a b holds if the string b starts-with the
string a.
Basically, the predicate expression !a matches any
property other than a; and a : # (respectively, !a : #)
matches any property that starts with a (respectively,
matches any property that does not starts with a).
Introducing Wild-card and Negation for Optimizing SPARQL Queries based on Rewriting RDF Graph and SPARQL Queries
183
For instance, [[airfrance:#]]
G
over the graph G
of Figure 1 is {hc
2
,c
3
i}, [[bus]]
G
= {} and [[!bus]]
G
=
{hc
1
,c
2
i, hc
2
,c
3
i, hc
3
,c
4
i}.
The following definition generalizes Def. 8 for
RDFS semantics (in particular, sub-property relation-
ship).
Definition 9 (Extended Semantics: RDFS). Given a
predicate expression E E and an RDF graph G,
then the semantics of E in G is defined as:
[[!a]]
rd f s
G
= {hx,yi| hx,b, yi G b a}
[[a : #]]
rd f s
G
= {hx,yi| hx,b, yi G (p;b a : p)}
[[!a : #]]
rd f s
G
= {hx,yi| hx,b, yi G (6 p;b a : p)}
where b a holds if b is a sub-property of a
2
.
Based on the above definition, [[bus:#]]
rd f s
G
=
{hc
3
,c
4
i} and [[!bus]]
rd f s
G
= {hc
1
,c
2
i, hc
2
,c
3
i} (Note
that hc
3
,c
4
i is not in the result since tag is a sub-
property of bus).
The following definition extends Def. 5 and uses
Def. 8 (respectively, Def. 9 for RDFS semantics)
to take into account predicate expressions including
negation and wild-card operators.
Definition 10 (Answers to Extended SPARQL Triple
Pattern). The evaluation of an extended SPARQL
triple pattern t = hS ,E,Oi over an RDF graph G is
defined as the following set of maps:
[[t]]
G
= {µ | dom(µ) = {S ,O} X X (E) and
hµ(S ),µ(O)i [[µ(E)]]
G
3
} such that µ(E) is the pred-
icate expression obtained by substituting the variable
?x appearing in E by µ(?x).
Hence, [[h?city1 (airfrance:#)
?city2 i]]
G
= {h?city1 c
2
,?city1 c
3
i}.
4 QUERYING RDF AND RDFS
GRAPHS
In this section, we show how the wild-card and nega-
tion operators can be used not only for optimizing the
evaluation of some queries but also for capturing extra
expressiveness over RDF(S) graphs.
4.1 Querying RDF Graphs
We believe that the wild-card and negation operators
can enhance the evaluation performance of some kind
2
a is neither an RDF(S) term nor a prefixed fragment of
an RDF(S).
3
(for RDFS [[µ(E)]]
rd f s
G
)
of SPARQL queries for querying RDF graphs since
they allow filtering results on-the-fly (e.g., query of
Example 4 matches only properties that belongs to
airfrance).
However, to express the query of Example 4 in
SPARQL 1.0 and SPARQL 1.1, a new variable should
be introduced in the query and then doing post-
filtering using filter constraint.
In the case of SPARQL 1.0, the operator regex
allows for implementing the ”starts with” function as
shown in the following query.
SELECT ?city1, ?city2
FROM ...
WHERE {
?city1 ?newVar ?city2 .
Filter (regex(?newVar, "ˆairfrance"))
}
In the case of SPARQL 1.1, the use of
wild-card operator can be implemented using the
fn:strstarts using FILTER constraints as shown in
the following query.
SELECT ?city1, ?city2
FROM ...
WHERE {
?city1 ?newVar ?city2 .
Filter (fn:strstarts(str(?newVar),
"airfrance"))
}
In both cases, variables are bound during query
execution for the triple h?city1 ?newVar ?city2i
and these instantiations are then tested with the spec-
ified function in the FILTER clause. In both cases
also, a new variable is introduced (?newVar) and it is
required to be used in the FILTER clause to constrain
the results. As this variable is not used in the query of
Example 4, the projection operator (SELECT clause)
thus is needed to restrict the result (i.e., to restrict the
result to only a set of values for the variables ?city1
and ?city2).
Though the evaluation of SPARQL queries com-
posed of AND and FILTER expressions (as the ones
in the above queries) is PTIME (P
´
erez et al., 2006b;
Schmidt et al., 2010), the evaluation of queries re-
quiring the projection operator (SELECT clause) over
RDF graphs will be NP-hard problem (see Section 7.1
in (P
´
erez et al., 2010) and (Chandra and Merlin, 1977)
for the evaluation problem for relational conjunctive
queries). Also, (Alkhateeb, 2008) demonstrated prac-
tically that evaluating queries with constraints on the
fly is better than a post processing phase. Addition-
ally, the constraints in the FILTER clause can be used
for syntactic matching only while the negation and
the wild-card operators can be used for RDFS sub-
property matching. For instance, the following query:
h?city1 !(transport:#) ?city2i
WEBIST 2016 - 12th International Conference on Web Information Systems and Technologies
184
when considering RDFS semantics (i.e., sub-
property semantics) should retrieve pairs of cities con-
nected by a property that is not a transport (not
prefixed by transport) or any of its sub-properties.
Implementing this query in SPARQL 1.1 (as the fol-
lowing one) may retrieve pairs of cities connected by
a property that is a sub-property of transport (e.g.,
bus). Besides, there is no clear method on how to deal
with this in SPARQL 1.0 and SPARQL 1.1 while we
provide in Section 4.2 a detailed discussion and ex-
amples on how to use wild-card and negation to deal
with sub-property matching.
SELECT ?city1, ?city2
FROM ...
WHERE {
?city1 ?newVar ?city2 .
Filter (NOT(fn:strstarts(str(?newVar),
"transport")))
}
This case is even worse if one wants to retrieve
pairs of cities connected by a sequence of flights be-
longing to airfrance company. This query could be
expressed using wild-card as follows:
h?city1 (airfrance:#)
?city2i
where * is the closure operator used in path ex-
pressions (e.g., regular expressions) to match a se-
quence of predicates (c.f. (Alkhateeb et al., 2009;
P
´
erez et al., 2010)).
Nonetheless, without using wild-cards, a variable
must be introduced with the closure operator to ex-
press the query and the evaluation of such queries
could be intractable for large graphs in particular
for finding simple paths (i.e., paths without loops)
(Mendelzon and Wood, 1995; Arenas et al., 2012) .
The wild-card could be combined with the nega-
tion operator to provide more interesting queries as in
the following simple one:
h?city1 !(airfrance:#) ?city2i
that retrieves pairs of cities connected by any
property that is not belonging to airfrance com-
pany.
4.2 Querying RDFS Graphs
Evaluating SPARQL queries over RDF graphs con-
sidering RDFS semantics needs additional treatment
either for the RDF graph to be queried (e.g., calcu-
lating the closure graph) or transforming the input
query to some form of path queries (see (Alkhateeb
et al., 2009; P
´
erez et al., 2010; Alkhateeb and Eu-
zenat, 2014) for querying a core fragment of RDFS
{sc, sp, type, domain, range}).
In this section, we propose a novel approach for
evaluating SPARQL queries over RDFS graphs with-
out the need to the closure operator *. In this ap-
proach, we rely on the fact that RDF Schema have
usually small size with respect to the RDF data graph.
The proposed approach consists of several steps that
are presented in the following.
1. We first build an index (hash table) for the RDF
Schema terms. Each entry in the index contains an
RDFS term t (i.e., RDFS terms that are appearing
in the RDF Schema of the RDF data graph) and
the corresponding ancestor terms represented as
a path from the root term to the parent term of t
denoted by PA
t
. Table 1 represents the index table
for the RDF Schema terms of Figure 1. It contains
two columns: one for the RDF Schema term and
the other for the path ancestor term in the RDF
Schema. For instance, the term tag has the path
ancestor term transport/bus since there exists a
path from tag to transport (i.e., htag sp busi
and hbus sp transporti).
2. Given an RDF data graph G, we construct an RDF
graph G
0
in the following way; for every triple hs,
p, oi G:
add hs, PA
p
/p, oi to G
0
, if p is a term ap-
pearing in the RDF Schema and p / {sc, sp,
type, domain, range}.
add hs, p, oi to G
0
, otherwise;
Graph G
0
in Figure 2 corresponds to
the RDF graph of Figure 1, where hc
3
transport/bus/tag c
4
i G
0
since hc
3
tag
c
4
i G and transport/bus is the path ancestor
of tag.
It should be noticed that G
0
is constructed one
time and not for each query. It can be updated
once the original RDF G is modified.
3. Given a SPARQL triple t = hs p oi, t is trans-
formed to t
0
= hs PA
p
/p:# oi.
According to this step, the following SPARQL
query:
h?city1 transport ?city2i
is transformed to the following one t
0
using the
index structure in Table 1:
h?city1 transport:# ?city2i
Note that transport has no path of ances-
tor terms since it is a root term in the RDF
Schema. Therefore, we just append the term with
the wild-card operator. However, the SPARQL
triple h?city1 bus ?city2i will be converted
h?city1 transport/bus:# ?city2i
4. Evaluate the triple t
0
over G
0
.
The same approach can be applied when using the
negation operator ! in the triple patterns by applying
Introducing Wild-card and Negation for Optimizing SPARQL Queries based on Rewriting RDF Graph and SPARQL Queries
185
Table 1: Index structure for the terms of the RDF Schema of Figure 1.
RDF Schema Term Path Ancestor Terms
transport null
plane transport
airfrance:flight1 transport/plane
bus transport
tag transport/bus
train transport
tgv transport/train
c
1
c
2
c
3
c
4
transport/plane/airfrance:flight1transport/train/tgv transport/bus/tag
G’
Figure 2: Transformed RDF graph (G
0
) corresponding to the RDF graph in Figure 1.
the above steps and preceding the predicate by !. To
illustrate this, consider the following triple t:
h?city1 !bus ?city2i
that should retrieve the set of pairs of citied con-
nected by a property, which is not a bus. This query
is transformed to the following one t
0
:
h?city1 !(transport/bus:#) ?city2i
In this case, by evaluating the transformed triple t
0
over G
0
, the pair hc
3
,c
4
i will not be among the result.
That is, hc
3
,c
4
i is not an answer since tag is a bus
(i.e., tag is a sp of bus).
SPARQL 1.1 (Glimm and Kroetzsch, 2010; Har-
ris and Seaborne, 2013) used the negation opera-
tor in the property paths. However, property paths
are evaluated without entailment (see Section 10.1 in
(Glimm and Ogbuji, 2013)). Therefore, the query
h?city1 !bus ?city2i when evaluated against G
will retrieve hc
3
,c
4
i as a pair in the result since syn-
tactically speaking tag is not a bus.
5 DISCUSSION AND
CONCLUSIONS
In this paper, we proposed an extension to SPARQL
that introduces two operators (the negation and the
wild-card) in SPARQL triple patterns. We have de-
fined the syntax as well as the semantics of these oper-
ators, in particular, when using them in the predicate
position of SPARQL triple patterns. Then, we have
shown that these two operators could be used to en-
hance the evaluation performance of some SPARQL
queries and to add extra expressiveness considering
RDF(S) semantics. This is even more important for
distributed path evaluation (Hartig and Pirr
`
o, 2015).
As shown in the paper, the use of the negation
and wild-card operators and thus the semantics are
different from the literature. More precisely, as dis-
cussed in the paper, the negation operator is used in
SPARQL 1.1 and other path languages without en-
tailment regime. On the other hand, the proposed ap-
proach deals with RDFS semantics (considering sp
relations). The proposed approach could be general-
ized to deal with sub-class (sc) relations by allowing
the wild-card to be used in the place of subject and
object of a triple (For instance, h?C p c
2
:#i).
Additionally, the proposed extended SPARQL
triple patterns can be seamlessly integrated in path
languages that are built on top SPARQL triple pat-
terns such as PSPARQL, cpSPARQL (Alkhateeb and
Euzenat, 2014), SPARQL 1.1, and nSPARQL (P
´
erez
et al., 2010). This will allow representing more com-
plex queries like:
h?city1 next::plan/[self::!(airfrance:#
)] ?city2i
that can be used to retrieve pairs of cities con-
nected by a plane but is not belonging to airfrance.
REFERENCES
Alechina, N., Demri, S., and de Rijke, M. (2003). A modal
perspective on path constraints. Journal of Logic and
Computation, 13:1–18.
Alkhateeb, F. (2008). Querying RDF(S) with regular ex-
pressions. Th
`
ese d’informatique, Universit
´
e Joseph
Fourier, Grenoble (FR).
Alkhateeb, F., Baget, J.-F., and Euzenat, J. (2008). Con-
strained regular expressions in SPARQL. In Arabnia,
H. and Solo, A., editors, Proceedings of the interna-
tional conference on semantic web and web services
(SWWS), Las Vegas (NV US), pages 91–99.
Alkhateeb, F., Baget, J.-F., and Euzenat, J. (2009). Ex-
tending SPARQL with regular expression patterns (for
querying RDF). Journal of web semantics, 7(2):57–
73.
Alkhateeb, F. and Euzenat, J. (2014). Constrained regular
expressions for answering RDF-path queries modulo
RDFS. International journal of web information sys-
tems, 10(1):24–50.
WEBIST 2016 - 12th International Conference on Web Information Systems and Technologies
186
Arenas, M., Conca, S., and P
´
erez, J. (2012). Counting be-
yond a yottabyte, or how sparql 1.1 property paths
will prevent adoption of the standard. In Proceedings
of the 21st World Wide Web Conference 2012, WWW
2012, Lyon, France, April 16-20, 2012, pages 629–
638.
Carroll, J. J. and Klyne, G. (2004). RDF concepts and ab-
stract syntax. Recommendation, W3C.
Chandra, A. K. and Merlin, P. M. (1977). Optimal im-
plementation of conjunctive queries in relational data
bases. In Proceedings of the ninth annual ACM sym-
posium on Theory of computing, pages 77–90. ACM.
Fionda, V., Pirr
`
o, G., and Consens, M. P. (2015). Extended
property paths: writing more SPARQL queries in a
succinct way. In Twenty-Ninth AAAI Conference on
Artificial Intelligence.
Glimm, B. and Kroetzsch, M. (2010). SPARQL beyond
subgraph matching. In Proc. 9th International Seman-
tic Web Conference (ISWC), Shanghai (CN), pages
59–66.
Glimm, B. and Ogbuji, C. (2013). SPARQL 1.1 entailment
regimes. Recommendation, W3C.
Harris, S. and Seaborne, A. (2013). SPARQL 1.1 query
language. Recommendation, W3C.
Hartig, O. and Pirr
`
o, G. (2015). A context-based semantics
for sparql property paths over the web. In The Seman-
tic Web. Latest Advances and New Domains, pages
71–87. Springer.
Manola, F. and Miller, E. (2004). RDF primer. Recom-
mendation, W3C. http://www.w3.org/TR/REC-rdf-
syntax/.
Mendelzon, A. and Wood, P. (1995). Finding regular simple
paths in graph databases. SIAM Journal on Comput-
ing, 24(6):1235–1258.
Mu
˜
noz, S., P
´
erez, J., and Gutierrez, C. (2009). Simple and
efficient minimal RDFS. Journal of web semantics,
7(3):220–234.
P
´
erez, J., Arenas, M., and Gutierrez, C. (2006a). Semantics
and complexity of SPARQL. In Proc. 5th Interna-
tional Semantic Web Conference (ISWC), Athens (GA
US), pages 30–43.
P
´
erez, J., Arenas, M., and Gutierrez, C. (2006b). Semantics
and complexity of SPARQL. In Proceedings of the 5th
International Semantic Web Conference, pages 30–43,
Athens (GA US).
P
´
erez, J., Arenas, M., and Gutierrez, C. (2009). Semantics
and complexity of SPARQL. ACM transactions on
database systems, 34(3):16.
P
´
erez, J., Arenas, M., and Gutierrez, C. (2010).
nSPARQL: A navigational language for RDF.
Journal of Web Semantics, 8(4):255–270.
http://www.sciencedirect.com/science/article/B758F-
4Y95V3X-1/2/9e5098d690fbe4d05a099f4c90a29a10.
Polleres, A. (2007). From SPARQL to rules (and back).
In Proc. 16th World Wide Web Conference (WWW),
pages 787–796.
Prud’hommeaux, E. and Seaborne, A. (2008). SPARQL
query language for RDF. Recommendation, W3C.
Schmidt, M., Meier, M., and Lausen, G. (2010). Founda-
tions of sparql query optimization. In Proceedings of
the 13th International Conference on Database The-
ory, pages 4–33. ACM.
Zauner, H., Linse, B., Furche, T., and Bry, F. (2010). A RPL
through RDF: Expressive navigation in RDF graphs.
In Proc. 4th International Conference on Web reason-
ing and rule systems (RR), Bressanone/Brixen (IT),
volume 6333 of Lecture Notes in Computer Science,
pages 251–257.
Introducing Wild-card and Negation for Optimizing SPARQL Queries based on Rewriting RDF Graph and SPARQL Queries
187