adding new Wikidata properties
Conzept currently supports all these Wikidata property classes: WikibaseItem, ExternalId, Url, String, Quantity, Time, Monolingualtext, CommonsMedia.
Only part of the following Wikidata classes are currently used on Conzept: CommonsMedia, GlobeCoordinate. These fields often require manual integration for their proper use in the Conzept UI.
These fields that still need to be supported in Concept: TabularData.
As new fields are frequently added to Wikidata, Conzept has some tooling to easily collect these new properties and integrate them properly.
process
To add new Wikidata property fields to the Conzept fields, use the following process:
- First fetch all Wikidata properties by executing the following script (located in the “app/explore2/tools” directory). The output is a “wikidata_properties.json” file.
./wikidata_properties_fetch.sh
- Create the new Conzept fields by running the “json2fields” script (also located in the “tools” directory).
- Notes:
- The command structure is: node json2fields.js “[PROPERTIES-FILE.json]” [PROPERTY-CLASS] > /tmp/output.txt
- You can run the script for each of the property-classes: WikibaseItem, ExternalId, Url, GlobeCoordinate, CommonsMedia, String, Quantity.
- The script will skip any Wikidata-fields which are already defined (by property number), so no duplicates are ever created).
- Example:
node json2fields.js "wikidata_properties.json" WikibaseItem > /tmp/new_fields.txt
- Include/merge the new property-class content of “/tmp/new_fields.txt” file into the “conzept_fields”-variable of “src/data/fields.js”.
- Note: With the Vim-editor this can be done as: “:r /tmp/new_fields.txt”
- Upgrade the Conzept version and rebuild:
sudo vi /etc/conzept/settings.conf
npm run build
×
>
<