Somnia commited on
Commit
1a2f22a
·
verified ·
1 Parent(s): 285ca73

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +125 -0
README.md ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc0-1.0
3
+ pretty_name: Depesche Wikidata Hot Index
4
+ tags:
5
+ - wikidata
6
+ - knowledge-graph
7
+ - entity-linking
8
+ - entity-resolution
9
+ - vector-search
10
+ - knowledge-base
11
+ size_categories:
12
+ - 10M<n<100M
13
+ language:
14
+ - en
15
+ - es
16
+ - ru
17
+ - fa
18
+ - ko
19
+ - ar
20
+ - zh
21
+ - ja
22
+ - de
23
+ - fr
24
+ - pt
25
+ - it
26
+ - tr
27
+ - id
28
+ - vi
29
+ - th
30
+ - hi
31
+ - uk
32
+ - pl
33
+ - nl
34
+ - sv
35
+ - he
36
+ - ms
37
+ - bn
38
+ - ur
39
+ - el
40
+ - cs
41
+ - ro
42
+ - hu
43
+ - fi
44
+ - nb
45
+ - nn
46
+ - ca
47
+ ---
48
+
49
+ # Depesche Wikidata Hot Index
50
+
51
+ A prebuilt, file-backed **Wikidata index** optimized for **entity linking (resolve)**, **facet / type checks (`is_a`)**, compositional queries, and **multilingual semantic similarity** — no external database required. Everything is mmap-friendly on-disk artifacts (FST, roaring bitmaps, CSR graphs, usearch vector shards).
52
+
53
+ **Reader / builder code:** https://github.com/mrink68/depesche-wd-index (Rust crates + `wd` CLI + PyO3 bindings)
54
+
55
+ ## Provenance
56
+
57
+ - **Source:** official Wikidata JSON dump `latest-all.json.gz` (~155 GB compressed), snapshot from **July 2026**
58
+ - **Build floor:** `build_min_sitelinks = 2` → **14,213,939 notable items** kept out of 120,905,360 scanned entities (P279 class edges are collected for *all* entities)
59
+ - **Index format:** `format_version 4`
60
+ - **Resolve languages:** 34 (aliases ingested for `en es ru fa ko ar zh ja de fr pt it tr id vi th hi uk pl nl sv he ms bn ur el cs ro hu fi no nb nn ca`)
61
+ - **License:** Wikidata content is [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/); this dataset is a derived transformation of it.
62
+
63
+ ## Contents (~30 GB)
64
+
65
+ | File | Size | What it is |
66
+ |---|---|---|
67
+ | `meta.json` | 3 KB | Build metadata: counts, languages, facet roots, hot properties |
68
+ | `entity_hot.bin` | 512 MB | Fixed-width hot rows (36 B/entity) incl. `sitelinks_n` |
69
+ | `entity_warm.zst` | 6.4 GB | Per-entity frames: display label + thin claims/sitelinks (zstd, `warm.zdict` dictionary) |
70
+ | `entity_dir.bin` | 341 MB | QID → hot/warm offset directory |
71
+ | `aliases.fst` | 2.3 GB | `lang\0normalized_surface` → postings offset (resolve index) |
72
+ | `alias_postings.bin` | 2.0 GB | Per-surface `(qid u32, sitelinks_n u16)` postings, popularity DESC |
73
+ | `edges.csr` | 1.4 GB | Undirected item-claim graph for `path()` BFS |
74
+ | `p279_parents.csr` / `p279_children.csr` | 57 / 23 MB | Subclass-of closure graphs |
75
+ | `p31_edges.bin` / `p279_edges.bin` / `p131_edges.bin` | 119 / 42 / 27 MB | Raw typed edges |
76
+ | `postings/P*.bin` | 95 MB | Filterable postings for P31, P17, P27, P39, P102, P106, P131, P279 (`match`/`inbound`) |
77
+ | `facets/*.roaring` + `summary.json` | 20 MB | Precomputed type bitsets (human, city, business, airport, film, …, 28 roots) |
78
+ | `coords.bin` | 46 MB | Geohash-bucketed P625 coordinates for `near()` |
79
+ | `vectors.f16.matrix` | 10.9 GB | 14,213,256 × 384 fp16 embedding matrix |
80
+ | `vectors.shard00..02.usearch` | 3 × 2.5 GB | Sharded ANN indexes (i8, cosine) — sharded because usearch breaks past 4 GiB/index |
81
+ | `vectors.shards.json` / `vectors.meta.json` | — | Shard map + embedding provenance |
82
+ | `warm.zdict` | 110 KB | zstd dictionary for `entity_warm.zst` |
83
+
84
+ **Embeddings:** `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2`, mean pooling, L2-normalized, text template `"{label}. {description}"`.
85
+
86
+ Two build intermediates are intentionally **not included** because they are regenerable from the files above using the repo code:
87
+
88
+ - `aliases.tsv` (11.5 GB) — rebuild from warm frames via `wd materialize` (`rebuild_aliases_tsv_from_warm`), or skip it: resolve uses `aliases.fst` directly
89
+ - `embed_corpus.tsv` (0.9 GB) — regenerate with `wd export-embed-corpus` (~18 min)
90
+
91
+ ## Usage
92
+
93
+ Download the dataset into an `index/` directory, then query it with the code from the [GitHub repo](https://github.com/mrink68/depesche-wd-index):
94
+
95
+ ```bash
96
+ hf download Somnia/depesche-wd-index --repo-type dataset --local-dir ./index
97
+
98
+ git clone https://github.com/mrink68/depesche-wd-index
99
+ cd depesche-wd-index && cargo build -p wd-cli --release
100
+
101
+ ./target/release/wd resolve --dir ../index "Spain" --lang en --limit 10
102
+ ./target/release/wd is-a --dir ../index Q31 sovereign_state
103
+ ./target/release/wd doctor --dir ../index # verify every artifact
104
+ ```
105
+
106
+ Or from Python (PyO3 bindings, `crates/wd-py`):
107
+
108
+ ```python
109
+ from wd_index import Index
110
+ idx = Index("./index")
111
+
112
+ idx.resolve("7-Eleven", lang="th") # alias FST, popularity-ranked
113
+ idx.match_([("P106", "Q82955"), ("P27", "Q183")]) # German politicians
114
+ idx.value_at("Q22686", "P39", 2019) # position held in 2019
115
+ idx.near(48.1374, 11.5755, radius_km=30, facet="airport") # geo query
116
+ idx.similar("Q90", k=20) # multilingual ANN over MiniLM vectors
117
+ ```
118
+
119
+ Full query surface (resolve / get / is_a / match / inbound / instances_of / types / subclasses / neighbors / value_at / top / count_by / near / path / similar) is documented in the repo README.
120
+
121
+ ## Notes
122
+
123
+ - Artifacts are **little-endian**; build and query on the same endianness (x86_64 is fine).
124
+ - Treat the directory as **immutable** — replace atomically on rebuild.
125
+ - Run `wd doctor` after download: it verifies every artifact and names what each absence silently breaks.