Dataset Viewer
The dataset viewer is not available for this subset.
Cannot get the split names for the config 'default' of the dataset.
Exception:    SplitsNotFoundError
Message:      The split names could not be parsed from the dataset config.
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 246, in _generate_tables
                  pa_table = paj.read_json(
                             ^^^^^^^^^^^^^^
                File "pyarrow/_json.pyx", line 342, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Column() changed from object to string in row 0
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 286, in get_dataset_config_info
                  for split_generator in builder._split_generators(
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 97, in _split_generators
                  pa_table = next(iter(self._generate_tables(**splits[0].gen_kwargs, allow_full_read=False)))[1]
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 260, in _generate_tables
                  batch = json_encode_fields_in_json_lines(original_batch, json_field_paths)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/utils/json.py", line 106, in json_encode_fields_in_json_lines
                  examples = [ujson_loads(line) for line in original_batch.splitlines()]
                              ^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/utils/json.py", line 20, in ujson_loads
                  return pd.io.json.ujson_loads(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              ValueError: Expected object or value
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/split_names.py", line 65, in compute_split_names_from_streaming_response
                  for split in get_dataset_split_names(
                               ^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 340, in get_dataset_split_names
                  info = get_dataset_config_info(
                         ^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/inspect.py", line 291, in get_dataset_config_info
                  raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
              datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Normalized Wikidata

A preprocessed text-form view of Wikidata, optimised for training language models or knowledge-graph world models. The goal is a corpus where the semantic content of Wikidata triples comes through cleanly, with the catalog-and-identifier clutter that dominates raw Wikidata by volume stripped out.

License inherits from Wikidata: CC-BY-SA 4.0.

This dataset is the input to a corresponding series of Loka world-model checkpoints at EmmaLeonhart/loka. Each snapshot here is named to match the Loka model trained on it — e.g. the v11-50k snapshot is the corpus the v11 Loka model was trained on, v12-100k corresponds to v12, and so on.

Snapshots

Tag Entity rows Output triples File size Trained Loka model
v11-50k (alias v0.1-50k) 50,000 350,428 14.7 MB EmmaLeonhart/loka@v11
v12-100k 100,000 671,817 28.4 MB EmmaLeonhart/loka@v12
v13-500k 500,000 2,511,771 109 MB (training in progress 2026-05-14)
v14-1M 1,000,000 4,021,409 176 MB (training queued behind v13)

All four corpus tiers are shipped as of 2026-05-14. The latest pushed tag is v14-1M. The total file-size sum across all four tiers is ~330 MB; pulling just the largest gives you the deepest training signal.

Pulling a specific snapshot:

from huggingface_hub import hf_hub_download
path = hf_hub_download(
    repo_id="EmmaLeonhart/normalized-wikidata",
    repo_type="dataset",
    filename="triples_normalized.txt",
    revision="v11-50k",  # or v12-100k, v13-500k, ...
)

Each snapshot is strictly larger than the previous — same first-N rows from the same upstream stream, just with N raised. The SQLite label cache at wikidata_labels.sqlite also grows monotonically across snapshots (~7,300 curated property labels preloaded, plus all entity labels seen in the slice).

What it is

One triple per line, tab-separated:

subject\tpredicate\tobject

All three positions are English labels — QIDs and PIDs are resolved to their rdfs:label@en. Entity labels come from the entity's own row in the source dump; property labels come from a curated cache of 7,312 manually- resolved Wikidata properties, never from corpus rdfs:label rows on properties (those are corrupted by an upstream RDF-star executor bug — see "Known issues with raw Wikidata" below).

What was stripped

Predicates whose Wikidata datatype falls into one of these classes are dropped entirely — they teach the model catalog formats rather than world knowledge, and v6 of the Loka world model demonstrated they leak format shapes onto unrelated predicates:

  • external-id (~10,206 properties) — Freebase ID, ISNI, GND, LCCN, Dewey, etc.
  • url (~120 properties) — links to external sites
  • commonsMedia (~91) — Wikimedia Commons filenames
  • math (~36) — LaTeX formulae
  • wikibase-sense / -lexeme / -form / -entity-schema (~47) — lexeme machinery
  • globe-coordinate (~10) — Point(lat lon) strings
  • geo-shape / musical-notation / tabular-data (~15) — rare, non-transferable

Predicates kept: wikibase-item, wikibase-property, string, quantity, time, monolingualtext.

In addition, object-level guards drop:

  • URL-shaped values (http://, https://, ftp://, irc://, mailto:) that slipped through with non-catalog predicates
  • Long digit-only strings (8+ digits — GND/VIAF/ISNI shape) and DOIs (10.NNNN/...) in the object position
  • Rows where the subject or object is itself a property IRI (wdt:P\d+) — these are RDF-star annotation rows surfacing in the wrong slot, never legitimate
  • System-reserved provenance triples (predicates under http://loka.dev/provenance/)

What was normalized

  • Time values: +YYYY-MM-DDTHH:MM:SSZYYYY-MM-DD (or YYYY-MM-DDTHH:MM:SS if time is non-zero). Leading + removed for CE years; - preserved for BCE.
  • Quantity values: leading + stripped from positive numbers (+12341234).
  • Monolingualtext: @lang tag stripped from the value. All languages kept; the model sees Tokyo and 東京 as plain values, not as Tokyo@en and 東京@ja.
  • Datatype suffixes on literals ("value"^^<...>): the suffix is parsed off so it doesn't leak into training tokens. The datatype is consulted to decide normalization rules and then dropped.

Known issues with raw Wikidata that this corpus addresses

  1. Catalog / identifier explosion. ~82 % of Wikidata's property types by count are external identifiers, URLs, or other non-semantic catalog refs. Training on them teaches the model catalog formats rather than world knowledge. We strip them by datatype.
  2. Property rdfs:label corruption when materialised through some RDF-star executors. A <<S P O>> rdfs:label "..."@en annotation row, depending on the executor, can surface as wdt:Pnnn rdfs:label "object-value"@en — i.e. the property gets keyed against the inner triple's object value instead of its real label. Entity labels are unaffected. We work around this by sourcing property labels from a curated cache and never from in-corpus rdfs:label rows on properties.
  3. Datatype suffix leakage. "2012-10-15T00:00:00Z"^^<...dateTime> if processed naively leaks tokens like xmlschema, dateTime etc. into the training corpus. We strip these.
  4. Mixed-language values. Wikidata's monolingualtext includes all languages; we keep them but strip the @lang tag so values like Tokyo and 東京 are plain strings.

How it was built

The current preprocessor streams philippesaade/wikidata directly from Hugging Face, with a SQLite label cache that persists across runs:

python tools/preprocess_from_hf.py \
    --max-rows 100000 \          # entity-row count, sets the size tier
    --label-db training/data/wikidata_labels.sqlite \
    --output training/data/normalized/normalized_wikidata_v12_100k.txt

Two passes over the dataset:

  • Pass 1 scans every row to extract English labels.en.value into the SQLite cache (constant memory regardless of corpus size).
  • Pass 2 streams again to emit the tab-separated text corpus, using the cache for label lookups, applying the noise-datatype filter, normalising time/quantity values, and dropping engine-bug-#2 RDF-star fallout at the s/o level.

Source code: tools/preprocess_from_hf.py, tools/hf_push_normalized.py.

An earlier two-pass version that fetched from a Loka .sdb over SPARQL (tools/preprocess_streaming.py) hit O(offset) cost at multi-million-triple scale; the HF-direct version sidesteps that by streaming the upstream parquet.

Provenance

See Loka on GitHub for the engine, the preprocessor source, the trained model checkpoints, and the paper describing the world-model training pipeline that motivated this corpus.

The Loka model series on Hugging Face: EmmaLeonhart/loka.

Citation

Wikidata is the upstream source. Please cite Wikidata as well as this dataset if you use the corpus.

Downloads last month
71