Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

WikiQuick

WikiQuick is a Python script designed to easily convert standard tabular CSV data into a format compatible with QuickStatements (QS) v1 commands, ensuring proper data normalization for various Wikidata data types.

⚙️ Usage

To start the application:

  1. Clone this repository locally or copy the main.py file.
  2. Execute the script based on your operating system:
PlatformCommand
Linux (Debian/Ubuntu)python3 main.py
WindowsDouble-click main.py
macOSpython3 main.py
  1. A file dialog will open. Select your CSV file to process
  2. The script performs automatic conversion. Upon successful completion, a new .tsv file (e.g., original_file_qs.tsv) containing the QuickStatements commands will be created in the same directory and automatically opened in your default text editor.

Import Steps (QuickStatements)

  1. Copy the content from the opened .tsv file
  2. Navigate to the QuickStatements interface
  3. Paste the content
  4. Start the import selecting the "Import commands CSV V1" option

🗂️ Preparing Your CSV File (Header Mapping)

QuickStatements requires specific formatting (e.g., quotes for strings, specific date formats, prefixes for coordinates). To determine the correct normalization for a column, you must append a type suffix or use a specific prefix in your CSV header.

Special Fields (Labels, Sitelinks, Qualifiers)

These fields use specific prefixes and formatting:

FieldTypeExample HeaderExample ValueNormalized Output
LxxLabel (Multilingual)LenHello worldLen,'Hello world'
DxxDescriptionDenHello worldDen,'Hello world'
AxxAliasAfrHello worldAfr,'Hello world'
xxwikiSitelinkfrwikiTemple de Chêne-Bougeriessitelink,frwiki,"Temple de Chêne-Bougeries"
SxxQualifierS854https://example.com

Data Type Suffixes

The following suffixes must be appended to the property ID (e.g., P21) to trigger the correct data type formatting:

SuffixTypeExample HeaderExample ValueNormalized Output
Item/ElementP31Q123Q123
_STRString LiteralP31_STRDante"Dante"
_NUMNumber (Float)P1082_NUM"12,53"12.53
_DATEDatestampP569_DATE10-06-2024+2025-06-10T00:00:00Z/11
_GEOGeo CoordinatesP625_GEO45.466944/9.19@45.466944/9.19

Important Note on Qualifiers

All qualifiers (Sxx) in a given CSV row are automatically attached to the first property (Pxx) encountered in that same row. If you have multiple properties in one row, only the first will carry the qualifiers.

About

CSV to QuickStatements v1 Converter

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages