wikidata-search/SKILL.md
Search for items and properties on Wikidata and retrieve entity details, claims, and external identifiers. Supports both keyword search (Wikidata Action API) and semantic/hybrid search (Wikidata Vector Database), plus direct entity retrieval (Special:EntityData) and structured querying (WDQS SPARQL).
npx skillsauth add kltng/humanities-skills wikidata-searchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Search and retrieve data from Wikidata, the free knowledge base.
This is the highest-value feature of this skill. The Wikidata Vector Database at wd-vectordb.wmcloud.org provides semantic/hybrid search over all Wikidata items — something you can't do with the standard Action API or SPARQL.
A descriptive User-Agent header is required or you get 403.
curl -H 'User-Agent: WikidataSearchSkill/1.0 (contact: [email protected])' \
'https://wd-vectordb.wmcloud.org/item/query/?query=historical+Chinese+cartography&lang=all&K=20'
Response includes QID, similarity_score, rrf_score, and source (vector vs keyword).
Property search: replace /item/query/ with /property/query/.
Optional params: lang, K (result count), instanceof (comma-separated QIDs), rerank.
curl -G 'https://query.wikidata.org/sparql' \
--data-urlencode 'query=SELECT ?item ?label WHERE { ?item wdt:P31 wd:Q12857432 . ?item rdfs:label ?label . FILTER(LANG(?label)="en") }' \
-H 'Accept: application/sparql-results+json' \
-H 'User-Agent: WikidataSearchSkill/1.0 (contact: [email protected])'
# claims[property_id][0]["mainsnak"]["datavalue"]["value"] → identifier string
# Common: P214 (VIAF), P244 (LoC), P227 (GND), P213 (ISNI), P268 (BnF)
| Need | Method |
|------|--------|
| Keyword search by label/alias | Action API wbsearchentities |
| Semantic / fuzzy concept discovery | Vector Database (hybrid vector + keyword) |
| Fetch a known entity's JSON | Special:EntityData/{ID}.json |
| Complex graph queries / reporting | WDQS SPARQL |
Use scripts/wikidata_api.py for programmatic access (zero dependencies):
from scripts.wikidata_api import WikidataAPI
wd = WikidataAPI()
# Keyword search
results = wd.search("Zhu Xi", language="en", limit=5)
# Semantic search (Vector DB) — the key differentiator
candidates = wd.vector_search_items("historical Chinese cartography", lang="all", k=20)
# Entity retrieval
entity = wd.get_entity("Q9397", props=["labels", "descriptions", "claims"])
# External identifiers
ids = wd.get_identifiers("Q9397", include_labels=True)
# → {'VIAF ID (P214)': '46768804', 'Library of Congress ID (P244)': 'n81008179', ...}
# SPARQL
results = wd.sparql_json("SELECT ?item ?label WHERE { ?item wdt:P31 wd:Q12857432 . ?item rdfs:label ?label . FILTER(LANG(?label)='en') }")
# Direct entity JSON (fast for current state)
data = wd.get_entitydata("Q42", flavor="simple")
| Endpoint | URL |
|----------|-----|
| Action API | https://www.wikidata.org/w/api.php |
| Entity JSON | https://www.wikidata.org/wiki/Special:EntityData/{ID}.json |
| SPARQL | https://query.wikidata.org/sparql |
| Vector DB | https://wd-vectordb.wmcloud.org |
Retry-After headersmaxlag parameter; batch with pipe-separated IDs (max 50)LIMITreferences/api_reference.md — Complete API specs for all four access methodsscripts/wikidata_api.py — Full-featured Python client with rate limiting, retries, and identifier extractiondevelopment
Query the China Biographical Database (CBDB) locally via SQLite for biographical data on 656K+ historical Chinese figures from the 7th century BCE through the 19th century CE. Use when searching for Chinese historical figures, scholars, officials, or literary figures — their biographical details, family/kinship networks, official postings, social associations, examination records, or addresses. Runs entirely locally after initial database download (~556 MB). Faster and more flexible than the API version.
development
Interact with a local Zotero 8 desktop application through its HTTP API at localhost:23119. Use this skill whenever the user wants to search, fetch, add, edit, or organize bibliographic items in their Zotero library, import citations (BibTeX, RIS, etc.), attach files, manage collections and tags, or retrieve full-text content from Zotero. Triggers on mentions of Zotero, citation management, reference libraries, bibliographic databases, or local library management. Also use when chaining with other catalog skills (Harvard, LOC, HathiTrust, etc.) to save found records into the user's Zotero library.
testing
Query and explore the TGAZ (Temporal Gazetteer) SQLite database of 82,000+ historical Chinese placenames spanning 763 BCE to 1911 CE. Use this skill whenever the user asks about historical Chinese places, administrative geography, dynastic jurisdictions, place name evolution, or wants to query tgaz.db. Also trigger when the user mentions CHGIS, TGAZ, historical gazetteer, Chinese historical GIS, or asks questions like "what was X called in dynasty Y", "what counties existed in year Z", "where was X located", or any spatial/temporal query about Chinese historical geography. This skill is relevant even for casual questions like "tell me about ancient Chang'an" or "Tang dynasty cities near the Yellow River".
development
Search the National Library Board (NLB) Singapore catalog for books, audiovisual materials, and digital resources via the official Catalogue API. Use this skill whenever the user wants to search Singapore's national library holdings, check book availability across NLB branches, look up titles by ISBN/BRN, find new arrivals, browse checkout trends, or retrieve detailed bibliographic records from NLB. Triggers when referencing Singapore library collections, Southeast Asian library holdings, or NLB resources.