Replies: 1 comment
-
I think the only way to test your theory is empirically. Also note that LLMs are continually improving and their representation of ontology graphs may change in the future. Eventually, we should setup a system to semi-automatically monitor the effect of in-context learning , as LLMs evolve. This would involve creating a dataset of NLQs and their expected SPARQLs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Typically, to convert a natural language question to SPARQL (NLQ2SPARQL), we provide a latent ontology as a
"schema" that describes the structure of an RDF database. This schema is fed as context to ChatGPT, which is then prompted with a question to generate the corresponding SPARQL query.
However, when the ontology itself is very large, it not only consumes a significant number of tokens but also makes it challenging for GPT to identify the correct entities (classes) and properties and to construct the SPARQL query accurately.
In my opinion, most natural language questions posed against an RDF graph can be translated into a subgraph (embodied in the prospective SPARQL code) where all the entities identified from the question are somehow connected and neighboured. This subgraph represents a portion of the overall ontology graph. Therefore, the key to effective NLQ2SPARQL conversion may lie in accurately locating the position of this subgraph within the larger general graph.
Beta Was this translation helpful? Give feedback.
All reactions