Reconcile Wikidata Osm
reconcile_wikidata_osmReconcile a set of Wikidata items against OpenStreetMap features of a given tag — the join Wikidata<->OSM community mapping efforts need before editing anything. Give either explicit Q-ids ("qids") or a SPARQL query that selects them ("sparql", must bind ?item to a wd:Q... URI — used to discover an arbitrary class, e.g. "every power station in country X"), plus an OSM tag filter ("osm_filter", e.g. "power=plant"). Fetches each item's coordinate (P625) and labels in the requested languages, searches OSM within radius_m of each, and scores candidates on THREE signals: an existing wikidata= tag (ground truth when present), cross-lingual name agreement, and distance. Returns one of four DISTINCT states per item: "matched" (confident link + evidence), "ambiguous" (2+ plausible candidates, ALL returned with scores — never auto-resolved), "unmatched" (the OSM search completed and found nothing plausible), or "error" (the search did NOT complete — no Wikidata coordinate, the item didn't resolve, or the Overpass call failed/timed out/was capped). "error" is never collapsed into "unmatched": a failed lookup is not evidence a thing is missing from OSM. Read-only — this does not write to Wikidata, Wikipedia or OpenStreetMap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qids | No | Wikidata Q-ids to reconcile, up to 200 — an array of strings or a comma/pipe-joined string (e.g. ["Q162887","Q3650523"] or "Q162887,Q3650523"). Provide this OR "sparql". | |
| sparql | No | A SPARQL SELECT that binds ?item to the Wikidata items to reconcile (up to 200 used) — e.g. "SELECT ?item WHERE { ?item wdt:P31/wdt:P279* wd:Q159719 . ?item wdt:P17 wd:Q230 . }" for every power station (Q159719) in Georgia (Q230). Labels and coordinates are fetched separately per item, so this query only needs to pick the set — it does not need to select labels or coordinates itself. Provide this OR "qids". | |
| radius_m | No | Search radius in metres around each item's coordinate, 10-20000 (default 300). An OSM feature carrying a matching wikidata= tag is still recognised as "matched" even if it falls outside this radius — the tag is ground truth. | |
| languages | No | Comma/pipe-joined language codes to compare, e.g. "ka,ru,en" — the shape needed when the same real-world place has different names in different languages (his own example: a Georgian power station named differently in Georgian, Russian and English). Every requested language's label is fetched and compared against every OSM name tag (name, name:<lang>, alt_name, int_name, official_name); a match in ANY requested language counts as name agreement, and the response says which one. Default "en" — pass the full set you actually need, an English-only comparison both misses real matches and can manufacture false ones. | |
| osm_filter | Yes | OSM tag filter(s) candidates must carry, as key=value, e.g. "power=plant" — or several alternatives comma-joined, e.g. "power=plant,power=generator" (OR-ed together). Required. | |
| overpass_timeout_s | No | Timeout passed to the Overpass query itself, 5-180 seconds (default 25). Lower it to fail fast over a large area rather than wait. |