Constrained Regular Expressions in SPARQL

RDF is a knowledge representation language dedicated to the annotation of resources within the Semantic Web. Though RDF itself can be used as a query language for an RDF knowledge base (using RDF consequence), the need for added expressivity in queries has led to the definition of the SPARQL query language. SPARQL queries are defined on top of graph patterns that are basically RDF (and more precisely GRDF) graphs. To be able to characterize paths of arbitrary length in a query (e.g., "does there exist a trip from town A to town B using only trains and buses?"), we have already proposed the PRDF (for Path RDF) language, effectively mixing RDF reasonings with database-inspired regular paths. However, these queries do not allow expressing constraints on the internal nodes (e.g., "Moreover, one of the stops must provide a wireless connection."). To express these constraints, we present here an extension of RDF, called CRDF (for Constrained paths RDF). For this extension of RDF, we provide an abstract syntax and an extension of RDF semantics. We characterize query answering (the query is a CRDF graph, the knowledge base is an RDF graph) as a particular case of CRDF entailment that can be computed using some kind of graph homomorphism. Finally, we use CRDF graphs to generalize SPARQL graph patterns, defining the CSPARQL extension of that query language, and prove that the problem of query answering using only CRDF graphs is an NP-hard problem, and query answering thus remains a PSPACE-complete problem for CSPARQL.

[1]  Krys J. Kochut,et al.  SPARQLeR: Extended Sparql for Semantic Association Discovery , 2007, ESWC.

[2]  Maarten de Rijke,et al.  A Modal Perspective on Path Constraints , 2003, J. Log. Comput..

[3]  Nigel Shadbolt,et al.  Resource Description Framework (RDF) , 2009 .

[4]  Steven J. DeRose,et al.  XML Path Language (XPath) , 1999 .

[5]  Eric Van Wyk,et al.  Universal Regular Path Queries , 2003, High. Order Symb. Comput..

[6]  Pierre Genevès,et al.  Efficient static analysis of XML paths and types , 2007, PLDI '07.

[7]  Raphael Volz,et al.  A Comparison of RDF Query Languages , 2004, SEMWEB.

[8]  Jean-François Baget,et al.  RDF with regular expressions , 2006 .

[9]  Marcelo Arenas,et al.  Semantics and Complexity of SPARQL , 2006, International Semantic Web Conference.

[10]  Georg Gottlob,et al.  A Comparison of Structural CSP Decomposition Methods , 1999, IJCAI.

[11]  Alberto O. Mendelzon,et al.  Querying the World Wide Web , 1996, Fourth International Conference on Parallel and Distributed Information Systems.

[12]  Alberto O. Mendelzon,et al.  Foundations of semantic web databases , 2004, PODS.

[13]  Alberto O. Mendelzon,et al.  A graphical query language supporting recursion , 1987, SIGMOD '87.

[14]  Peter T. Wood,et al.  Queries on graphs , 1989 .

[15]  Catherine Faron-Zucker,et al.  Querying the Semantic Web with Corese Search Engine , 2004, ECAI.

[16]  Herman J. ter Horst,et al.  Completeness, decidability and complexity of entailment for RDF Schema and a semantic extension involving the OWL vocabulary , 2005, J. Web Semant..

[17]  Herman J. ter Horst,et al.  Extending the RDFS Entailment Lemma , 2004, SEMWEB.

[18]  Dan Suciu,et al.  A query language and optimization techniques for unstructured data , 1996, SIGMOD '96.

[19]  Amit P. Sheth,et al.  SPARQ2L: towards support for subgraph extraction queries in rdf databases , 2007, WWW '07.

[20]  Jean-François Baget,et al.  RDF Entailment as a Graph Homomorphism , 2005, SEMWEB.

[21]  Alberto O. Mendelzon,et al.  GraphLog: a visual formalism for real life recursion , 1990, PODS '90.

[22]  Alberto O. Mendelzon,et al.  G+: Recursive Queries Without Recursion , 1988, Expert Database Conf..

[23]  Jennifer Widom,et al.  The Lorel query language for semistructured data , 1997, International Journal on Digital Libraries.

[24]  Yanhong A. Liu,et al.  Parametric regular path queries , 2004, PLDI '04.