SPARQL Query Optimization with SHACL Constraints

SPARQL is the query language of the Semantic Web, and SHACL is a standardised constraint language.  Can we use constraints on the data to simplify queries?

The answer is yes :-)  We have some theoretical results that show how to simplify queries in some situations.  Given, e.g.,

  • a query that asks for people in a KG along with their names and their year of birth if this is known.  In SPARQL this is expressed as OPTIONAL, corresponding to an outer join in SQL
  • a constraint that guarantees that the year of birth is present for all people in the dataset

Then we can simplify the query by removing the OPTIONAL part.  Evaluation of OPTIONAL is potentially costly, so this could be worth while.

So far, the results are only theoretical

  • We want an implementation of the method
    • This will require working with a Semantic Web programming framework like Jena or OpenRDF
    • The algorithm is not trivial, so coding skills and careful thought are required
  • The implementation will allow us to test the impact of optimisation on real queries and real data sets.
  • Testing may highlight limitations in the method, that could be addressed by the MSc thesis

 

Published Sep. 25, 2024 3:11 PM

Supervisor(s)

Scope (credits)

60