Hi David,

thanks for your reply. I double-checked the case. Oh, indeed I made a 
mistake on my side. :-( 

Yes, you are right. The validation of the above graph is fine. 

Best regards, Kai

On Friday, 8 April 2022 at 17:55:20 UTC+2 David Price wrote:

> 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 <[email protected]> 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 [email protected].
> 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 <+44%207788%20561308>
> US +1 (336) 283-0808 <(336)%20283-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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/82fa1ae2-525d-4e3d-ac98-19149e7f7aa0n%40googlegroups.com.

Reply via email to