# Wikidata

This provider exposes tools and data accessible through its parent verticals. Use the example prompts as inspiration for your queries.

**Slug:** `wikidata`

**Description:** Query the world's largest open knowledge graph with 100M+ structured items. Resolve entity and property names to Wikidata codes, then run natural-language or raw SPARQL searches against the Wikidata Query Service.

## Verticals

This provider is available in the following verticals:

- [News](https://kirha.com/verticals/news.md)

## Example prompts (non-exhaustive)

- `Who are the most famous people who died yesterday?`
- `Map all companies that share board members with JPMorgan Chase`
- `List all pharmaceutical companies headquartered in Switzerland`
- `List all subsidiaries of Alphabet with their industries and countries`
- `Find all NYSE-listed companies founded by Stanford alumni`
- `Find all drugs that treat Alzheimer's disease, with their manufacturers`
- `Find all hospitals within 10km of central Tokyo`
- `List all current Members of the European Parliament with their political parties`

## Available tools in this provider

Open a tool to see its input and output schemas.

### [`searchWikidata`](https://kirha.com/providers/wikidata/searchWikidata.md)

Search the Wikidata knowledge graph by natural-language question. Translates the question to a SPARQL query grounded on the caller-provided Q-codes and P-codes, executes it against the Wikidata Query Service, and returns the result rows plus the exact SPARQL that was run (see `query` in the output). REQUIRED WORKFLOW: (1) call `resolveCodes` to look up the Q-codes for every entity and P-codes for every property your question mentions, then (2) call this tool with the question AND the resolved id arrays. Passing the ids is critical — it prevents code hallucination, the #1 failure mode of text-to-SPARQL. PREFERRED FIRST CHOICE for factual, quantitative, or relational questions about the world: facts about people/places/organizations/works, populations, dates, rankings, relationships, lists with filters, or cross-referencing entities. When NOT to use: opinions/reviews/sentiment, recent news, webpage content, pricing/real-time market data — use a web search tool for those. Built-in auto-repair: if the generated query errors or returns 0 results on a list-shaped query, a single LLM-powered repair pass is attempted, grounded on live metadata for any Q/P codes in the query.

### [`resolveCodes`](https://kirha.com/providers/wikidata/resolveCodes.md)

Resolve human-readable names to Wikidata Q-codes (entities) and P-codes (properties) in a single batch call. This is the essential first step before building any SPARQL query — never guess codes. Pass a list of entity names (people, places, organizations, concepts) and/or property names (e.g., 'date of birth', 'occupation', 'country of citizenship') and get back flat arrays of matching Q-codes and P-codes ready to pipe into `searchWikidata`.Typical workflow: resolveCodes → feed `entityIds` and `propertyIds` into searchWikidata along with the question.

-----

**Tags:** knowledge graph, wikidata, sparql, open data, semantic web

[< Back to providers list](https://kirha.com/providers.md)