weso / hercules-sync

Tools to synchronise data between the ontology files and Wikibase instance for the Hercules project at University of Murcia.
GNU General Public License v3.0
4 stars 1 forks source link

Allow boolean datatypes #35

Open alejgh opened 4 years ago

alejgh commented 4 years ago

Boolean datatypes are not supported by wikibase (see https://phabricator.wikimedia.org/T145528). The alternative is to represent the boolean with a wikibase-item datatype which points to a Truth or False item in wikibase.

We need to implement the _create_wditemid_frombool function from the mappings module to provide this functionality. This method will parse the content (True of False) and reference the qid of the boolean item. The qid will be created if it doesn't exist yet (we have to set a custom label and description to look for it or create it if the search doesn't return any value).