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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

ShEx2SPARQL: Translating Shape Expressions into SPARQL Queries

  • Christoph Göpfert,
  • Sheeba Samuel,
  • Martin Gaedke

摘要

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.