An Algorithm for Context-Free Path Queries over Graph Databases

Ciro M. Medeiros, M. A. Musicante, U. S. Costa
{"title":"An Algorithm for Context-Free Path Queries over Graph Databases","authors":"Ciro M. Medeiros, M. A. Musicante, U. S. Costa","doi":"10.1145/3427081.3427087","DOIUrl":null,"url":null,"abstract":"Path queries are used to specify paths inside a data graph to match a given pattern. Query languages such as SPARQL usually include support for regular path patterns defined by means of regular expressions. Context-free path queries define a path whose language can be defined by a context-free grammar. This kind of query is interesting in practice in domains such as genetics, data science, or source code analysis. In this paper, we present a novel algorithm for context-free path query processing. Our algorithm works by looking for localized paths, allowing us to process subgraphs, in contrast to other approaches that have to process the whole graph. It also takes any context-free grammar as input, avoiding the use of normal forms that are more problematic in practice. The output of our algorithm provides enough information to reconstruct the paths matching the query. We prove the correctness of our approach and show its runtime and memory complexity. We show the viability of our approach by means of a prototype implemented in Go. We run experiments proposed in recent works, which include both synthetic and real RDF databases. Our algorithm shows some performance gains when compared with other algorithms implemented using single-thread programs.","PeriodicalId":350427,"journal":{"name":"Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-04-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3427081.3427087","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Path queries are used to specify paths inside a data graph to match a given pattern. Query languages such as SPARQL usually include support for regular path patterns defined by means of regular expressions. Context-free path queries define a path whose language can be defined by a context-free grammar. This kind of query is interesting in practice in domains such as genetics, data science, or source code analysis. In this paper, we present a novel algorithm for context-free path query processing. Our algorithm works by looking for localized paths, allowing us to process subgraphs, in contrast to other approaches that have to process the whole graph. It also takes any context-free grammar as input, avoiding the use of normal forms that are more problematic in practice. The output of our algorithm provides enough information to reconstruct the paths matching the query. We prove the correctness of our approach and show its runtime and memory complexity. We show the viability of our approach by means of a prototype implemented in Go. We run experiments proposed in recent works, which include both synthetic and real RDF databases. Our algorithm shows some performance gains when compared with other algorithms implemented using single-thread programs.
图数据库中上下文无关路径查询算法
路径查询用于指定数据图中的路径,以匹配给定的模式。诸如SPARQL之类的查询语言通常支持通过正则表达式定义的正则路径模式。上下文无关的路径查询定义了一个路径,该路径的语言可以由上下文无关的语法定义。这种查询在遗传学、数据科学或源代码分析等领域的实践中很有趣。本文提出了一种新的无上下文路径查询处理算法。我们的算法通过寻找局部路径来工作,允许我们处理子图,而其他方法必须处理整个图。它还接受任何与上下文无关的语法作为输入,避免使用在实践中更有问题的标准形式。我们算法的输出提供了足够的信息来重建匹配查询的路径。我们证明了该方法的正确性,并展示了其运行时和内存复杂度。我们通过在Go中实现的原型来展示我们方法的可行性。我们运行了最近工作中提出的实验,其中包括合成的和真实的RDF数据库。与使用单线程程序实现的其他算法相比,我们的算法显示出一些性能提升。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信