Hi,
I use VocBench 15.1.0
What should i do differently to avoid SHACL error report pop-up when adding an object property to an individual?
All this is new to me, so please correct me in any way.
[1] In a self made Ontology there are some classes and some object properties defined.
Lets say:
* classes : A, B, C, D
* object properties : 'contains'
[2] A SHACL was defined and used to make the custom forms for creation of individuals.
Some rules are :
* in the shape for class A :
sh:property [
sh:path jan:contains ;
sh:minCount 0 ;
sh:class jan:B ;
sh:message "A class A can only have 'contains' relationships with a B" ;
];
* in the shape for class B:
sh:property [
sh:path jan:contains ;
sh:minCount 0 ;
sh:or (
[ sh:class jan:C ]
[ sh:class jan:D ]
) ;
sh:message "A class B can only have 'contains' relationships with a C or D" ;
] ;
[3] This works like a charm with custom forms for creation of individuals.
Custom forms are super good. :-)
[4] Now my real question
When selecting to add a 'contains' object property to an existing individual a popup appears for selecting an individual to relate to.
But the choice of classes in the pop-up is too large and may generate a SHACL error report popup after selecting a class that breaks the rule.
How can i avoid this?
2 things i tried :
(a) add Domains and Ranges to the 'contains' object property
Domains : A, B
Ranges : B, C, D
This gives a limited list of classes and is a step into the right direction. The list always consist of A and B independant of the selected individual where we want to add the 'contains' relationship to.
So it is still possible to make a selection that brakes the SHACL rule.
(b) add class axioms
* For class A (
rdfs:subClassOf
):
:contains ONLY :B
* For class B
(
rdfs:subClassOf
)
:
:contains ONLY ( :C OR :D)
Does not seem to have any effect on the list of classes in the pop-up.