wikidata_lookup
Find real Wikidata items for a query and check their types against an expected QID. Returns annotated candidates with descriptions; leave field empty if no match.
Instructions
Find real Wikidata items for a term, and type-check them.
Call it for every Wikidata topic or keyword destined for a nanopub field. It returns candidates with their descriptions and real P31/P279 types; it deliberately does NOT choose one, because picking the right sense of an ambiguous label is a judgement. What it guarantees is that the QID you publish exists and is what you say it is.
Pass expected_type as a QID (e.g. Q16521 taxon, Q11862829 academic
discipline) and each candidate is marked typeMatches from its actual
statements. Candidates are annotated, never filtered — a near miss is often
the informative result. Searching "Bombus" with Q16521, for instance,
returns the insect genus as a match and the album of the same name as not.
A zero-candidate result means leave the field empty or try another label. Never fall back to a QID from memory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| expected_type | No |