Natural Language Access to Domain-Specific Metadata: A Reusable Framework for LLM Query Generation

📄 arXiv: 2607.18029v1 📥 PDF

作者: Blake G. Fitch, Cato Elia Kurtz

分类: cs.DB, cs.AI

发布日期: 2026-07-20


💡 一句话要点

提出自然语言访问领域特定元数据框架以解决查询生成问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 自然语言处理 知识图谱 大型语言模型 元数据查询 本体论 SPARQL 领域特定应用

📋 核心要点

  1. 现有方法在处理领域特定档案时,研究人员常常缺乏编写结构化查询的能力,导致信息获取困难。
  2. 本文提出的NLKGQ系统通过OWL本体捕捉领域词汇和语义,使LLM能够直接生成SPARQL查询,简化了查询过程。
  3. 实验结果显示,最佳配置在能力和回归问题集上实现100%准确率,且可重用性强,适用于多个领域。

📝 摘要(中文)

研究人员在处理领域特定档案的内容时,常常缺乏编写结构化查询的专业知识。本文展示了如何通过设计良好的Web本体语言(OWL)本体,使大型语言模型(LLMs)能够在零样本情况下生成准确的结构化查询,而无需微调、检索增强或多代理协调。我们提出了自然语言知识图谱查询(NLKGQ)系统,该框架和开发过程使研究人员能够自然语言访问这些档案中的元数据。该框架包括一个Web界面,帮助研究人员提出自然语言问题,并通过LLM将其转换为SPARQL并在知识图谱上执行。我们在大规模神经影像研究档案的元数据上展示了该系统,评估了多种LLM和本体表示,最佳配置在与领域专家共同开发的能力和回归问题集上实现了100%的准确率。

🔬 方法详解

问题定义:本文旨在解决研究人员在访问领域特定档案时,因缺乏专业知识而无法编写有效查询的问题。现有方法通常依赖于复杂的查询语言,难以使用。

核心思路:通过构建一个形式化的OWL本体,捕捉领域特定的词汇和语义,使得LLM能够在零样本情况下生成结构化查询,从而简化查询过程。

技术框架:NLKGQ系统的整体架构包括:1) Web界面,供研究人员输入自然语言问题;2) 领域无关的转换工具,将自然语言问题转换为SPARQL;3) 知识图谱,存储从档案中提取的元数据。

关键创新:最重要的创新在于使用OWL本体来定义领域特定的语义,使得LLM能够高效生成准确的查询,区别于传统的依赖手动编写查询的方式。

关键设计:系统设计中强调可重用性,领域特定代码提取元数据并导入知识图谱,且在实验中发现可读的实体名称和语义注释是影响准确性的主要因素。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,最佳配置在能力和回归问题集上实现了100%的准确率,且通过对比SPARQL与自动生成的SQL数据库,证明了OWL的结构特性在LLM驱动的查询生成中具有显著优势。

🎯 应用场景

该研究的潜在应用领域包括医学研究、社会科学和人文学科等领域的档案管理。通过简化查询生成过程,研究人员能够更高效地访问和利用领域特定的元数据,促进跨学科研究和数据共享,未来可能对数据驱动的研究产生深远影响。

📄 摘要(原文)

Researchers need to answer ad-hoc questions about the contents of domain-specific archives but often lack the expertise to write structured queries on the metadata. We show that when domain vocabulary and semantics are captured in a well-designed Web Ontology Language (OWL) ontology, Large Language Models (LLMs) can generate accurate structured queries zero-shot, without fine-tuning, retrieval augmentation, or multi-agent orchestration. We present the Natural Language Knowledge Graph Query (NLKGQ) system, a framework and development process that enables natural language access to metadata in such archives. The framework includes a web interface that helps researchers pose natural language questions, which a domain-agnostic harness translates to SPARQL via an LLM and executes against a knowledge graph. The development process begins with capturing domain vocabulary and semantics in a formal OWL ontology. Domain-specific code then extracts metadata from archive sources and imports it into a knowledge graph defined by the ontology. Both are designed for reuse across domains. We demonstrate the system on metadata derived from a large-scale neuroimaging research archive, evaluating multiple LLMs and ontology representations. The best configurations achieve 100% accuracy on a competence and regression question set developed with domain experts. An ablation study across eight ontology representations reveals that readable entity names and semantic annotations are the dominant factors in accuracy, more significant than model choice or prompt engineering. We also compare SPARQL to an auto-generated SQL database as query backends, showing that OWL's structural features provide a substantial advantage over SQL DDL for LLM-driven query generation. Our demonstration domain also requires local LLMs on modest institutional hardware to address privacy concerns for human subject data.