In graph data applications, data is primarily maintained using two models: RDF (Resource Description Framework) and property graph. The property graph model is widely adopted by industry, leading to property graph databases generally outperforming RDF databases in graph traversal query performance. However, users often prefer SPARQL as their query language, as it is the W3C's recommended standard. Consequently, exploring SPARQL-to-Property-Graph-Query-Language translation is crucial for enhancing graph query language interoperability and enabling effective querying of property graphs using SPARQL. Despite the substantial differences in semantic representation and processing logic between SPARQL and property graph query languages like Cypher, this paper demonstrates the feasibility of translating SPARQL to Cypher for graph traversal queries using graph relational algebra. We present the S2CTrans framework, which achieves SPARQL-to-Cypher translation while preserving the original semantics. Experimental results with the Berlin SPARQL Benchmark (BSBM) datasets show that S2CTrans successfully converts most SELECT queries in the SPARQL 1.1 specification into type-safe Cypher statements, maintaining result consistency and improving the efficiency of data querying using SPARQL.
翻译:在图数据应用中,数据主要通过两种模型进行维护:资源描述框架(RDF)和属性图。属性图模型被工业界广泛采用,使得属性图数据库在图遍历查询性能上通常优于RDF数据库。然而,用户往往更偏好使用SPARQL作为查询语言,因为它是万维网联盟(W3C)推荐的标准。因此,探索SPARQL到属性图查询语言的翻译对于增强图查询语言互操作性、实现利用SPARQL有效查询属性图至关重要。尽管SPARQL与Cypher等属性图查询语言在语义表示和处理逻辑上存在显著差异,本文基于图关系代数论证了将SPARQL翻译为Cypher以执行图遍历查询的可行性。我们提出了S2CTrans框架,该框架在保留原始语义的前提下实现了SPARQL到Cypher的翻译。基于柏林SPARQL基准测试(BSBM)数据集的实验结果表明,S2CTrans成功地将SPARQL 1.1规范中的大多数SELECT查询转换为类型安全的Cypher语句,保持了结果一致性,并提升了使用SPARQL进行数据查询的效率。