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 ontologies with blank nodes #46

Closed alejgh closed 4 years ago

alejgh commented 4 years ago

We need to support the synchronisation of changes regarding blank/anonymous nodes. For example:

:played_by a owl:ObjectProperty ;
     rdfs:label "played by"@en ;
     rdfs:domain [ a owl:Restriction ;
             owl:onProperty :played_by ;
             owl:someValuesFrom :Song ] ;
     rdfs:range [ a owl:Restriction ;
             owl:onProperty :played_by ;
             owl:someValuesFrom :Artist ] .

In order to implement this we will need to add a way to parse BNodes from RDFLib in our TripleInfo.from_rdflib method.

I don't know if this will be straightforward or not.

I think that maybe the predicates inside these blank nodes should be treated as qualifiers in wikibase, but we need to discuss this (e.g. what predicate could be used to define the value and not the qualifiers...).

We should also consider if this issue includes the functionality of parsing 'QualifiedValues' from the hercules-ontology.

alejgh commented 4 years ago

This is a really interesting issue.

There was already a task on the Wikimedia Phabricator platform regarding this. In Wikidata blank nodes represent either:

I am thinking currently about three different ways to handle blank nodes:

Other possibilities are appreciated and welcome.

Each one has various degrees of complexity, but in my opinion we should choose the cleanest and most reasonable solution to solve this if possible.

This is an important decision to be made, and it needs to be as stable and coherent as possible. I will discuss it with @labra and @spitxa.