GeoNames 1277333
Bengaluru · Q1355
Live entity JSON returned P1566 1277333, normal rank. Label and identifier are consistent.
Decision brief / data integration
Store only GeoNames ID → Wikidata QID. The consuming API Worker fetches Wikidata/Wikipedia metadata on demand, outside the GeoNames search path.
Publish only the identifier crosswalk. Fetch metadata in the consuming API Worker.
No labels, aliases, Wikipedia titles or extracts, images, or websites are copied into the GeoNames mapping store. First run a bounded P1566 coverage/collision pilot before approving a global import. Mapping import, lookup, and consumer fetching are not implemented by this documentation change.
01 / Existing contract
| Source/current field | GeoNames import/service | Enrichment gap |
|---|---|---|
| allCountries.txt | ID, names, comma-separated aliases, country/admin1/admin2 codes, feature class/code, coordinates, population, timezone. | cc2, admin3/admin4, elevation, DEM, and modification date are discarded by this importer. No imported Wikipedia link; aliases here are not language-tagged links. |
| countryInfo.txt | Country reference attributes including country TLD, capital name and the country's GeoNames ID. | No country website field. TLD does not establish a particular place's official website. |
Public Location | ID, names, country/admin codes and joined labels, feature class/code/label, coordinates, population, timezone, aliases. | No QID, Wikidata aliases, Wikipedia article title, Commons image, or P856 official website. |
Evidence inspected in the current importer import-global.ts, schema.ts, types.ts, locations.ts, plus the GeoNames dump field definition. The recorded baseline has 13,472,195 locations.
02 / Identity, not resemblance
Wikidata P1566 GeoNames ID is an external identifier. Match its string value to the numeric canonical GeoNames ID. Do not match solely by label, spelling, country, or coordinates; a city, municipality, metro area, and administrative region can be different entities.
GeoNames 1277333
Live entity JSON returned P1566 1277333, normal rank. Label and identifier are consistent.
GeoNames 1261481
Live entity JSON returned P1566 1261481, normal rank with a GeoNames source reference.
P1566's property page reports expected completeness as "always incomplete" and stability as "sometimes changes." Resolve redirects to current QIDs and retain provenance in extraction reports outside the serving table. Exclude deprecated claims; prefer preferred-rank claims when present, otherwise normal-rank claims. Report multiple distinct active values, conflicting QIDs for one GeoNames ID, and unresolved redirects for review instead of choosing one. A redirect is identity maintenance, not another place.
03 / Mapping-only storage
One approved, non-null QID per mapped GeoNames ID. Absence means unmapped. Ambiguous candidates stay in review reports, not published rows. Multiple GeoNames IDs may share a QID, so QID is not a unique key.
CREATE TABLE geonames_wikidata_mapping (
geoname_id INTEGER PRIMARY KEY,
qid TEXT NOT NULL
);Keep extraction revisions, retrieval times, redirects, candidate QIDs, and collision reasons in publication/review reports outside the serving table. Version and roll back the mapping artifact, not entity metadata. Choose placement only after measuring a pilot; this decision neither provisions nor requires a separate D1/R2 resource.
The consuming API Worker resolves the QID for a selected GeoNames ID and requests labels, aliases, sitelinks, and requested claims from Wikibase. For Wikipedia content, use the actual language-specific sitelink with that wiki's API, never a title inferred from the place name. The consumer owns language selection, optional caching, request limits, and upstream failure handling. Metadata caches remain separate from the GeoNames search cache.
The consumer fetches this optional statement when needed and verifies suitability before display. It is not stored in the mapping.
The consumer resolves the filename and checks the Commons file's current license, creator credit, and restrictions before display. No image or filename is stored in the mapping.
Fetch language-specific labels, aliases, and sitelinks on demand. A sitelink is not a GeoNames alias; article metadata stays consumer-owned.
Primary property sources: P18, P856, P1566, and Commons reuse guidance. Commons states each file may have its own credit/license requirements and recommends verifying rights; a filename is not a blanket reuse permission.
04 / Capacity and placement
Current remote database
5.07 GB
5,074,595,840 bytes
Paid D1 limit used here
10.00 GB
10,000,000,000 bytes
Baseline headroom
4.93 GB
4,925,404,160 bytes
The earlier 512–1,024-byte row estimate included copied entity metadata and is superseded. The two-column mapping stores an integer key and QID text; measure actual SQLite page/index overhead, coverage, concurrent gazetteer growth, and staging/rollback copies on representative rows. No mapping-size measurement or global coverage estimate exists. The remote size above is a recorded baseline, not a new remote measurement. Cloudflare documents a 10 GB paid limit; the arithmetic uses a conservative decimal planning ceiling.
Do not infer that the mapping fits or exceeds D1 from the old metadata estimate. Storage placement requires measured mapping-only bytes and approval. No separate enrichment database, object-backed metadata store, or metadata backfill is part of this decision.
05 / Controlled update path
The sequence below is an implementation proposal, not an existing command or live import. Use an approved Wikidata API or bounded P1566 extract. No full dump or broad SPARQL scan is needed for the pilot.
Bounded P1566 extract
↓
normalize QID redirects, claim ranks, deletions
↓
intersect with existing GeoNames IDs; report unmatched/collisions
↓
stage idempotently → quarantine ambiguities → validate and measure
↓
explicit approval → publish version → retain rollback versionPREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT ?item ?id WHERE { VALUES ?id { "1277333" "1261481" } ?item wdt:P1566 ?id }. Audit matched QIDs with Wikibase wbgetentities using props=info|claims to inspect full P1566 ranks/values and redirects. The truthy-query projection is not complete audit evidence. This pilot is proposed, not run.geoname_id and qid with a unique GeoNames key and deterministic upsert. Reconcile removals and additions; report ambiguity rather than overwriting canonical records. Validate counts, keys, and QID resolution; keep provenance in reports.All future extract, stage, reconcile and publish commands are proposed unimplemented. Do not run GeoNames seed commands for this feed.
06 / Search and failure behavior
07 / Pilot exit criteria
08 / Primary sources
Verified claims are limited to repository source inspection, the current stated capacity figures, and the two live entity examples checked 2026-09-30. Coverage, conflict rate beyond the two examples, actual enrichment bytes, deployment, and all proposed commands remain unmeasured or unimplemented. No Wikidata data was imported.