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成功地将SPARQL1.1规范中的大多数SELECT查询转换为类型安全的Cypher语句,保持结果一致性并提高使用SPARQL查询数据的效率。