ShEx2SPARQL: Translating Shape Expressions into SPARQL Queries
摘要
The Shape Expressions (ShEx) Language provides a powerful tool for describing and validating structures in RDF knowledge graphs. While Shape Expressions are primarily used for validation, they also describe graph structures, enabling knowledge graph exploration. However, existing ShEx engines focus on validation rather than data exploration. In this paper, we introduce ShEx2SPARQL, an approach to systematically translate shape expressions into corresponding CONSTRUCT, SELECT, or ASK SPARQL queries. This enables knowledge graph exploration based on already available ShEx schemas. Our approach imposes certain restrictions, notably the exclusion of recursive shape references, as SPARQL lacks sufficient support for recursive expressions. To evaluate our approach, we selected 292 Wikidata Entity Schemas, translated them into corresponding SPARQL queries and executed them against the Wikidata SPARQL endpoint. The results confirm the feasibility of our approach, but also reveal performance issues when executing complex SPARQL queries resulting from complex shapes with a multitude of constraints.