Skip to Main content Skip to Navigation

Querying RDF(S) with Regular Expressions

Faisal Alkhateeb 1
1 EXMO - Computer mediated exchange of structured knowledge
Inria Grenoble - Rhône-Alpes, LIG - Laboratoire d'Informatique de Grenoble
Abstract : 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 semantic consequence), the need for added expressivity in queries has led to define the SPARQL query language. SPARQL queries are defined on top of graph patterns that are basically RDF graphs with variables. SPARQL queries remain limited as they do not allow queries with unbounded sequences of relations (e.g. "does there exist a trip from town A to town B using only trains or buses?"). We show that it is possible to extend the RDF syntax and semantics defining the PRDF language (for Path RDF) such that SPARQL can overcome this limitation by simply replacing the basic graph patterns with PRDF graphs, effectively mixing RDF reasoning with database-inspired regular paths. We further extend PRDF to CPRDF (for Constrained Path RDF) to allow expressing constraints on the nodes of traversed paths (e.g. "Moreover, one of the correspondences must provide a wireless connection."). We have provided sound and complete algorithms for answering queries (the query is a PRDF or a CPRDF graph, the knowledge base is an RDF graph) based upon a kind of graph homomorphism, along with a detailed complexity analysis. Finally, we use PRDF or CPRDF graphs to generalize SPARQL graph patterns, defining the PSPARQL and CPSPARQL extensions, and provide experimental tests using a complete implementation of these two query languages.
Document type :
Complete list of metadatas

Cited literature [53 references]  Display  Hide  Download
Contributor : Faisal Alkhateeb <>
Submitted on : Monday, July 7, 2008 - 11:18:28 AM
Last modification on : Thursday, November 19, 2020 - 1:00:25 PM
Long-term archiving on: : Tuesday, September 21, 2010 - 5:07:48 PM


  • HAL Id : tel-00293206, version 2




Faisal Alkhateeb. Querying RDF(S) with Regular Expressions. Computer Science [cs]. Université Joseph-Fourier - Grenoble I, 2008. English. ⟨tel-00293206v2⟩



Record views


Files downloads