I’m not sure what exactly is happening in your case and did not test anything, 
but SHACL and the TB SHACL engine understands class hierarchies just fine.

Perhaps you simply need to also declare the classes as being owl:Class?  Not 
all NodeShapes are also owl:Class, but in your case it appears they are.

Cheers,
David

> On 8 Apr 2022, at 16:16, Kai Liu <kai-...@siemens.com> wrote:
> 
> Assume that we have the following shapes:
> ==========================
> ex:Person
>   a owl:Thing ;
>   a sh:NodeShape ;
>   sh:property ex:Person-hasFriend  ;
> .
> ex:Person-hasFriend
>   a sh:PropertyShape ;
>   sh:path ex:hasFriend ;
>   sh:class ex:Person ;
> .
> ex:NicePerson
>   a sh:NodeShape ;
>   rdfs:subClassOf ex:Person ;
> .
> ==========================
> and the following instance data:
> ==========================
> ex:Alice a ex:NicePerson .
> ex:Peter a ex:NicePerson .
> ex:Peter ex:hasFriend ex:Alice .
> ==========================
> 
> The validation for the above instance data will fail, because ex:Alice is 
> explicitly a ex:NicePerson instead of a ex:Person. However, ex:Alice is 
> indeed implicitly a ex:Person (RDFS inference). Is there a solution to define 
> a superclass in a property shape in order to validate the instances of its 
> subclasses? The reason why I am asking is that we currently have to list all 
> of the subclasses with "sh:or" in a property shape, in order to pass the 
> validation, which is very tedious.
> 
> Thanks.
> 
> Best regards, Kai
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to topbraid-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/ee7b968b-8a35-4484-b591-59027adde585n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/ee7b968b-8a35-4484-b591-59027adde585n%40googlegroups.com?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808‬

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to topbraid-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/1CB778FD-21A2-4250-AEC1-C5B81862E816%40topquadrant.com.

Reply via email to