wikidata-store — reader of the offline Wikidata store
Mova keeps a trimmed copy of the full Wikidata dump as mova-pack containers (pack). This crate reads it: an entity by id, the item values of a property, the entity of a wiki page, an entity's sitelinks, the property table. It only reads; the store is built elsewhere from latest-all.json.bz2.
The store
A directory ($MOVA_WIKIDATA, else store):
| file | content | key |
|---|---|---|
entities.mpk, entities.idx.zst | one entity per JSON line: id, type, datatype (properties), labels, descriptions, aliases, claims, sitelinks, trimmed to the content languages of the kept wikis plus mul and en | id = the entity id |
sitelinks.mpk, sitelinks.idx.zst | lines site:title \t id | t = site:title, q = the id |
properties.tsv.zst | id \t datatype \t lang=label… | — |
build.json, Elamur Cosmic License | the build report; Wikidata is CC0 1.0 | — |
The copy on s2 (built 2026-11-19): 121 971 281 entities, 94.4 M sitelinks.
Run
cargo build --release -p wikidata-store
wikidata-store [--dir DIR] entity Q90
wikidata-store claims Q142 P36 # Q90: the capital of France is Paris
wikidata-store id frwiki Paris # Q90
wikidata-store sitelinks Q90 # site \t title
Library: Store::open, Store::entity, Store::id_for, Store::sitelinks, claim_items (preferred statements if any, else normal; deprecated never), label (falls back to mul), read_properties. A lookup decodes one block of the container; on s2 one call of the command takes about 0.3 s, mostly opening the index.
Limits
Read-only, one Store per thread. Only item values of claims are typed (claim_items); other datatypes are in the JSON. Light entities (without a sitelink to a kept wiki) have no references, statement ids or aliases. The format belongs to mova-pack and is not frozen.
Geographic points
wikidata-store geo-classes classes.tsv
wikidata-store geo QIDS.tsv classes.tsv OUTDIR
Both commands accept an optional final record limit for prefix checks. Use the
same limit in both. The class table records the source pack's content identity
and prefix length. Both scans read entities.mpk with up to six CPU threads.
The settlement table includes Earth points of instances of human settlement
(Q486972) and its subclasses whose population is at least 10,000. It also
includes any item in the first column of QIDS.tsv with its own Earth point.
Population takes the newest P585 within the best usable P1082 rank. Undated
ties use statement order. Area uses the first usable P2046 at the best rank
and converts to square kilometres using Wikidata's direct SI factors for
unfamiliar units. Empty fields mark unavailable values. Coordinates are in
decimal degrees. Country is the first best-rank P17.
The district table includes own Earth points with P31 under the configured centre, central business district, tourist attraction, museum, monument, square, neighbourhood and quarter roots. When several roots match, priority is centre, business, tourist, then district. Within a category the nearest root by P279 wins, with configured root order breaking ties. The class QID column reports the winning root. The settlement column is the first direct P131 pointing to a selected, typed settlement, falling back to the first direct P131. Both tables are sorted by numeric QID.
This page in Markdown https://md.mova.elamur.ai/free/en/docs/tools/wikidata-store/