Wikidata MCP: Grounded SPARQL Query Generation
🎥 Session recording: [https://youtu.be/JLUm5WbtDAk?t=8710](https://youtu.be/JLUm5WbtDAk?t=8710)
This session introduces the [Wikidata Model Context Protocol (MCP)](https://www.wikidata.org/wiki/Wikidata:MCP), a standardized set of tools that enables large language models (LLMs) to explore and query Wikidata programmatically. While many LLMs can produce syntactically correct SPARQL queries, they often lack a deeper understanding of Wikidata’s data model and domain-specific relationships. The MCP connects LLMs to the Wikidata API and the Wikidata Query Service, guiding them through structured workflows to support users in their research.
A central component of this approach is the [Wikidata Vector Database](https://www.wikidata.org/wiki/Wikidata:Vector_Database), developed within the[ Embedding Project](https://www.wikidata.org/wiki/Wikidata:Embedding_Project). The vector database enables semantic search over Wikidata entities, supporting discovery beyond keyword search and graph traversal. By allowing models to identify conceptually related entities, semantic search provides contextual grounding before query generation.
In this session, we will present the Wikidata MCP and the Vector Database, demonstrate how to leverage language models to explore Wikidata and generate SPARQL queries, and show how this approach supports transparent, grounded responses while reducing hallucinations and misinformation.