WQ42: Converse with Wikidata
Wikidata, the database of all knowledge, is sometimes understood – even among Wikimedians – as a mysterious place behind Wikipedia that requires some special knowledge to use and edit. But imagine you could ask about the content of Wikidata directly in natural language and receive the answer in the same easy way. This is what the project WQ42 can do.
What is Wikidata
Put simply, you can think of Wikidata as a massive, free, and collaboratively built database of facts that can be used by both humans and computers. Instead of full-text articles like the ones on Wikipedia, it stores information in a structured, machine-readable format — for example, that Brno is a city located in the Czech Republic and it has a specific size of population. These data points are interconnected, creating a knowledge network of people, places, events, works of art, and countless other subjects. Just like Wikipedia, anyone can use it and help improve it. It describes all kinds of notable entities that exist — every published book, every existing language, elected politicians, cities, or even types of fruit.
The simplest visible function of Wikidata is providing interlanguage links for Wikipedia. Every Wikipedia article is linked to a certain Wikidata item –for example the article “Brno” is linked to item number Q14960. Thanks to this connection it is clear that the German-language article on the same topic is “Brünn”, because it is linked to the same Wikidata item.
In addition to this, every Wikidata item is described through other items. This is done through so called statements. One can think of every statement as a simple phrase that describes the item it belongs to in some way. For example “Brno – is instance of – municipality in the Czech Republic”. Or “Brno – [is] located in the administrative territorial entity – Brno-City District”. This way it is possible to describe any kinds of relationships about the nature of things, languages used, parenthood, diverse activities and much more. Moreover those declarations are language-independent, they exist practically in all languages at once and so one doesn’t need to translate them for their own sake.
What is WQ42
WQ42 is a small project available at wq42.toolforge.org and created by software developer Santhosh THOTTINGAL working for the Wikimedia Foundation. It serves as another interface to access the information stored in Wikidata. Through it one can ask Wikidata or give it instructions in natural language – and receive an answer in the same way. It is noteworthy that the interface is made to be read-only and it cannot by itself change the content of Wikidata in any way.
To be able to answer questions in natural language, WQ42 uses a large language model (LLM) in the background, whose task is to understand the question or instruction, decide which items it needs to visit, and produce the answer. In its default configuration, it uses the Gemini 2.5 Flash language model, but because the program is free/libre software, one can host it oneself and use it with another open-weight or fully open language model.
The language model receives strict instructions, which it is obliged to give its answers based only on the information stored in Wikidata and so it should much less hallucinate or answer according to the information on which it was trained. It also always mentions the items from which it took the information, what reminds its users that the information comes from Wikidata. Hallucinations and non-attribution of sources of the information provided are often mentioned problems of chatbots in general.
Limitations of use
Such a strict obligation as that the chatbot always answers only based on the information from Wikidata, naturally brings some limitations. If some information is missing in Wikidata – because nobody has put it there yet – the chatbot cannot answer even if it is a fact, to a human, fully obvious.

However, when answering the first question “What is the colour of the sky?” the language model supposed, that as a machine, it cannot see the sky and directly replied that it is unable to answer the question without even looking at Wikidata. But even when I gave it direct instruction to look at the relevant Wikidata item it couldn’t give me the answer, because in the item about the sky the colour of the sky is really not mentioned. It is undoubtedly good that the chatbot had no problem to say that it didn’t know instead of disobeying the instructions and trying to answer based on its training data or directly hallucinate the answer.
It’s noteworthy that the chatbot shows the user each usage of its tools. So one can see that it searched for the Wikidata item for “the sky” and that it accessed the item it found, but it didn’t do anything unrelated to its task.
Another limitation stems from the fact that the chatbot always accesses the live database of Wikidata. If some random user experiments or directly vandalises the item you have just asked about then you can receive unpredictable answers.
The chatbot can also use a module for the Lua programming language. Through this module, it can perform mathematical calculations or comparisons, but its abilities are variable depending on the language model used. Because of this, it cannot answer correctly how many years ago Albert Einstein died.

But it can do simple arithmetic calculations well only through the Lua module without need to ask Wikidata about anything.

Even when the exercise was given to it in natural language, it used the Lua module well to calculate the result, which is 67 😉
And finally – WQ42 in its current state doesn’t have access to a SPARQL interface, so it cannot answer questions like “Give me a list of all cities and towns in South Korea with more than 50,000 inhabitants.”
One should keep these limitations in mind when using WQ42 and those examples can also serve to test the capabilities of other language models used.
Answering questions about simple facts
The first evident use for WQ42 is to ask about simple facts, for example about the capitals of countries.

As shown in the image the chatbot answered correctly and provided a link to the relevant Wikidata item.
It is also possible to answer questions about other basic facts such as the anthem of the Czech Republic.

The chatbot correctly answered that the anthem of the Czech Republic is the song Kde domov můj and alongside the link, it also provided a recording of the anthem, because it can be found on Wikimedia Commons. That happens to the other multimedia files too – such as images and videos.

Finding and describing relationships
Naturally, WQ42 can not only answer questions on facts about individual items, but of course can describe relationships between two or more items, if the relationship between them is direct.

When needed, it can also visit several Wikidata items and draw the answer from them.

Summary
WQ42 is an interesting example of a tool that enables access to the knowledge stored in Wikidata through natural language, without the need to know the details of how Wikidata works in the background. This dependency on Wikidata at least partially solves the problem of source attribution as well as the problem of having the answers up-to-date, because WQ42 forces the language model to link to the source items on Wikidata and to use the live and so up-to-date database of Wikidata. The price for this is that the language model cannot use its inner knowledge and so it cannot answer even those questions that are for humans very easy in general.
In this way, WQ42 can bring Wikidata closer to people for whom the form of question—answer in natural language is easier than the ordinary technical interface of Wikidata, but it also shows an example how language models can be directly linked to a human-curated knowledge source. Any missing or incorrect information can be added or corrected by humans and the result will be directly visible in the answers of WQ42.
Now it’s up to you to “play” with the tool and discover its capabilities and limitations within your own context.
