https://github.com/yaph/wikidata-dl
wikidata-dl is a command line program for downloading data from Wikidata based on SPARQL queries.
https://github.com/yaph/wikidata-dl
cli command-line-tool data-retrieval download downloader python-package sparql wikidata
Last synced: 6 months ago
JSON representation
wikidata-dl is a command line program for downloading data from Wikidata based on SPARQL queries.
- Host: GitHub
- URL: https://github.com/yaph/wikidata-dl
- Owner: yaph
- License: mit
- Created: 2019-10-04T11:15:22.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-12-15T20:44:25.000Z (about 1 year ago)
- Last Synced: 2025-07-05T00:51:55.831Z (6 months ago)
- Topics: cli, command-line-tool, data-retrieval, download, downloader, python-package, sparql, wikidata
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# wikidata-dl
## Description
**wikidata-dl** is a command line program for downloading data from [Wikidata](https://www.wikidata.org/) based on [SPARQL](https://en.wikipedia.org/wiki/SPARQL) queries.
## Installation
pip install wikidata-dl
## Usage
Download result returned from the query and save it in the directory `./wikidata`:
wikidata-dl /path/to/my-query.sparql
For a complete reference of the command line options run:
wikidata-dl --help
## Sample Query
The following query returns IDs for all Wikidata entities that are an instance of ([P31](https://www.wikidata.org/wiki/Property:P31)) a continent ([Q5107](https://www.wikidata.org/wiki/Q5107)).
SELECT ?item WHERE {
?item wdt:P31 wd:Q5107.
}
[Try the query](https://query.wikidata.org/#SELECT%20%3Fitem%20WHERE%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ5107.%20%7D)