Wikidata Sparql

v0.2.1
io.github.pipeworx-io/wikidata-sparql Checked 4 days ago Published 29 days ago

Wikidata SPARQL MCP — Wikidata Query Service

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

query

Run a SPARQL query against the Wikidata Query Service. Returns JSON bindings by default.

ParameterTypeDescription
formatstringjson (default) | xml | csv | tsv | text/html
querystringAlias for `sparql`.
sparqlstringSPARQL query text. Also accepts `query` as an alias.

current_officeholder

Who currently holds a political office / leadership position for a place — answers "who is the current mayor of London", "who is the prime minister of Japan", "president of France", "governor of California", "who leads <city/country>". Give the place or organization name; returns the current head of government (mayor / premier / prime minister) and head of state (president / monarch) with their name and start date, from Wikidata. Coverage is best for countries and major cities; small municipalities may not be recorded.

ParameterTypeDescription
of *stringThe place or organization, e.g. "London", "Japan", "California", "São Paulo". Resolved to a Wikidata entity automatically.
langstringLanguage for names (default en; use e.g. "pt" for Portuguese place/person names).

instances_of

Convenience: list all items that are an instance of a Wikidata class.

ParameterTypeDescription
entity_id *stringClass id (e.g. "Q5" = humans, "Q5398426" = TV series)
langstringLanguage for labels (default en)
limitnumberMax items (default 100, max 10000)

subclasses_of

Return all subclasses of a Wikidata class via transitive P279 (subclass-of) traversal; takes a Wikidata entity id (e.g. Q11424) and returns labelled subclass items up to the specified limit.

ParameterTypeDescription
entity_id *string
langstring
limitnumber

properties_of

Convenience: all statements (property → value) about an entity.

ParameterTypeDescription
entity_id *stringItem id (e.g. "Q42" = Douglas Adams)
langstring
limitnumber

entities_at

Geo-spatial query: items near a point. Use instance_of to filter by class.

ParameterTypeDescription
latitude *number
longitude *number
instance_ofstringClass id filter (e.g. "Q33506" = museum)
langstring
limitnumber
radius_kmnumberSearch radius in km (default 1)