SPARQL to SQL query rewriting engine

90 Views Asked by At

I am looking for ontology based data access (OBDA) system capable of SPARQL to SQL query rewriting to convert the following SPARQL query:

SELECT ?interface ?ip WHERE { ?interface network:hasIpAddress ?ip. ?ip network:containedWithin "192.168.1.0/24". }

or, alternatively:

SELECT ?interface ?ip WHERE { ?interface network:hasIpAddress ?ip. FILTER(?ip IN "192.168.1.0/24"). }

... to the following SQL query:

SELECT interface, ip FROM interfaces WHERE ip_address << "192.168.1.0/24"

*Notes:

  1. "<<" operator in SQL WHERE statement is specific to PostgreSQL type "inet": https://www.postgresql.org/docs/9.3/functions-net.html
  2. For a general case, "192.168.1.0/24" may be considered as parameter that must be passed down from SPARQL to SQL filtering engine.*

I would be grateful if you could advise solutions for the problem.

I explored Ontop, Sparqlify and a few others alike. They seem to be based on graph materialization approach that assumes "exportability" of SQL database data as triples. To answer query in question query rewriting seems to be needed to employ special index of SQL database to find matching records.

0

There are 0 best solutions below