mapping-master icon indicating copy to clipboard operation
mapping-master copied to clipboard

Rules creating class and individuals should not fail if ran twice

Open csnyulas opened this issue 9 years ago • 1 comments

If I run a rule like

Individual: @A*
  Annotations: rdfs:comment @B*

multiple times, I get the following error:

screenshot cellfieerror entityalreadyexists

In comparison, a rule like this can be run multiple times, without any error:

Class: @A*
    SubClassOf: @B*

In the case of a class declaration, if an entity that would be generated from a cell is already found in the ontology (and has the right type), the existing entity would be used in the rest of the rule. This is the desired behaviour, and should happen for individual declarations as well (and in the future also for object, data and annotation property declarations, too) .

csnyulas avatar Oct 06 '16 23:10 csnyulas

This problem comes up in this issue as well: protegeproject/cellfie-plugin/issues/131

Interestingly enough, although this rule cannot run twice (or multiple times):

Class: @A*(rdf:id)
    Annotations: rdfs:label @B* 
    SubClassOf: @C*
    SubClassOf: isMyFavorite value @D*(xsd:boolean)

this one can:

Class: @A*(rdf:id)
    SubClassOf: @C*
    SubClassOf: isMyFavorite value @D*(xsd:boolean)

However, again, this can not:

Class: @A*(rdfs:label=@B* rdf:id)
    SubClassOf: @C*
    SubClassOf: isMyFavorite value @D*(xsd:boolean)

All these seem to suggest that the problem occurs when there are some annotations (such as rdfs:label or rdfs:comment) added to the class.

csnyulas avatar Jan 18 '18 23:01 csnyulas