Skip to main content
eScholarship
Open Access Publications from the University of California

Query Relaxation for LLM-Generated SPARQL Queries over Building Knowledge Graphs

Abstract

When Knowledge Graph (KG) queries fail to match a pattern in a KG, they return no results. Identifying the statements causing these failures is tedious, especially for LLM-generated queries, which tend to be longer and more complex than queries written by hand. Query relaxation addresses this by systematically loosening query constraints until results are recovered. To evaluate the effectiveness of query relaxation against LLM generated queries, we propose a two-stage relaxation method combining triple deletion and path relaxation and test it against 1,823 failed queries for building KGs.

Many UC-authored scholarly publications are freely available on this site because of the UC's open access policies. Let us know how this access is important for you.