Generate ready-to-run QuickStatements v2 batches straight from live Wikidata entities.
- Pulls the requested entities from Wikidata and rewrites their labels, descriptions, aliases, statements, qualifiers, references, and sitelinks as QuickStatements commands.
- Prioritises a preferred language while keeping every other language value that exists on the entity.
- Maintains qualifiers, references, and statement ranks so the imported batch mirrors Wikidata exactly.
- Accepts any number of QIDs, removes duplicates, and emits the results in the same order they were requested.
- Can throttle requests to respect rate limits, and can emit the raw entity payload as prettified JSON for inspection or diffing.
-
Install the Rust toolchain from rustup.rs if it is not already available.
-
Clone this repository and change into the project directory.
-
Build and install the command-line tool:
cargo install --path .The binary will be placed in Cargo’s bin directory (usually
~/.cargo/bin).
To try it without installing, use cargo run --release -- <args> from the project root.
Fetch a single entity and generate a QuickStatements batch:
existing-statements Q42Select a preferred language for labels and descriptions while keeping the rest:
existing-statements Q42 Q1 --language esThrottle API calls when processing many entities:
existing-statements Q42 Q1 Q2 --max-rate 1.5Inspect the fetched entities by exporting the structured JSON instead of QuickStatements:
existing-statements Q42 --format jsonThe command exits with a non-zero status if any entity cannot be fetched. Successful runs print the generated batch to standard output; redirect it to a file and feed it straight into QuickStatements.
- Combine the output with QuickStatements’ “Import commands” dialog to seed new items or replicate an existing entity before editing.
- Use
quickstatements.mdin this repository as a reference for how the generator lays out commands and how QuickStatements interprets each field. - When working through large lists of entities, consider batching them by 50 QIDs or less to keep output manageable and stay friendly to the API.