The advent of large language models is contributing to the emergence of novel approaches that promise to better tackle the challenge of generating structured queries, such as SPARQL queries, from natural language. However, these new approaches mostly focus on response accuracy while ignoring other evaluation criteria, such as runtime and cost to generate SPARQL queries. Consequently, they are often not production-ready or easy to deploy over real-world knowledge graphs with good accuracy. To mitigate these issues, in this paper, we describe and systematically evaluate SPARQL-LLM, an open-source and triplestore-agnostic approach, powered by lightweight metadata, that generates SPARQL queries from natural language text. First, we describe its architecture, which consists of dedicated components for metadata indexing, prompt building, and query generation and execution. Then, we evaluate it based on a state-of-the-art challenge with multilingual questions, and a collection of questions from three of the most prevalent knowledge graphs within the field of bioinformatics. Our results demonstrate a substantial improvement of up to 59% in F1 score over the second-best system participating in the challenge, adaptability to high-resource languages such as English, Spanish, and German, as well as ability to form complex bioinformatics queries. Furthermore, our results show that our system is up to 27x faster than the second-best system participating in the challenge, while costing a maximum of $0.01 per question, making it suitable for real-time, low-cost text-to-SPARQL applications. SPARQL-LLM is publicly released as an open-source project at https://github.com/sib-swiss/sparql-llm and is currently deployed over real-world decentralized knowledge graphs at https://www.expasy.org/chat.
SPARQL Query Generation with LLMs: Measuring the Impact of Training Data Memorization and Knowledge Injection
img/wse-cube-no-shadow.png Web \& Software Engineering (WSE) Research Group, Leipzig University of Applied Sciences (HTWK Leipzig), Leipzig, Germany CBZ München GmbH, Heilbronn, Germany
GGC: Selective Query Correction for Reliable Text-to-SPARQL Generation
Nanyang Technological University(南洋理工大学);Institute of High Performance Computing, Agency for Science, Technology and Research (A*STAR)(新加坡科技研究局高性能计算研究所)
SPARQL Generation: an analysis on fine-tuning OpenLLaMA for Question Answering over a Life Science Knowledge Graph
Department of Ecology and Evolution, University of Lausanne, Switzerland(生态与进化系,洛桑大学,瑞士);SIB Swiss Institute of Bioinformatics, Lausanne, Switzerland(瑞士生物信息学研究所,洛桑,瑞士)
Compressed k2-Triples for Full-In-Memory RDF Engines
当前的“数据洪流”已经用非常大的RDF数据集淹没了Web of Data。它们通过SPARQL端点托管和查询,SPARQL端点充当基于关联数据项目原则构建的语义网络的节点。尽管这是全局数据发布的现实哲学,但当RDF引擎(在端点后面)管理这些巨大的数据集时,其查询性能会降低。它们的索引不能完全加载到主存中,因此这些系统需要执行缓慢的磁盘访问来解决SPARQL查询。本文通过一种紧凑的索引RDF结构(称为k2-triples)来解决这个问题,该结构将紧凑的k2-树结构应用于众所周知的垂直划分技术。它获得了大型RDF图的超压缩表示,并允许SPARQL查询在内存中完全执行而无需解压缩。我们表明,k2-三元组明显优于国家的最先进的压缩性和传统的垂直分区查询分辨率,保持非常有竞争力的多索引解决方案。