Hi Andrew,

it is perfectly fine to have multiple property shapes for the same sh:path 
(property). So at the root class you could have

ex:Location
    a dash:ShapeClass ;
    rdfs:subClassOf owl:Thing ;
    sh:property ex:Location-has_part ;
.
ex:Location-has_part
    a sh:PropertyShape ;
    sh:path ex:has_part ;
    sh:name "has part" ;
.

and then define the sh:class in the subclasses

ex:Level
    a dash:ShapeClass ;
    rdfs:subClassOf ex:Location ;
    sh:property ex:Level-has_part ;
.
ex:Level-has_part
    a sh:PropertyShape ;
    sh:path ex:has_part ;
    sh:class ex:Room ;
.

I would move all general constraints into the superclass but anything specific 
remains in the subclasses only.

HTH
Holger


> On 25 Aug 2023, at 7:45 pm, Andrew Arnold <[email protected]> wrote:
> 
> Hello Holger,
> 
> I have a  Location class with Site, Facility, Level, and Room sub-classes. 
> 
> The Location class defines the Location relation properties 'has_part' and 
> the inverse 'part_of';  however the constraints on these relations are 
> different for each sub-class.  For example:
> 
> A Facility can have a Facility or a Level as a part, but not a Room 
> A Level can have a Room as a part, but not a Site or Facility
> 
> Can I define and bind a property shape to each sub-class that permits me to 
> specify the constraints for each one discretely or do I need to define the 
> properties redundantly for each sub-class ?
> 
> Thanks, Andrew
> 
>    
> dpr:Location
>   a owl:Class ;
>   a sh:NodeShape ;
>   rdfs:label "Location" ;
>   rdfs:subClassOf dpr:AECO ;
>   sh:property dpr:Location-hasPart ;
>   sh:property dpr:Location-hasPart-inverse ;
> .
> 
> 
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to [email protected]
> --- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/50d24bad-03b4-4a21-991c-9033b8a9190dn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/50d24bad-03b4-4a21-991c-9033b8a9190dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to [email protected]
--- 
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/D76EAC37-F500-40B7-BFE7-4323862419B8%40topquadrant.com.

Reply via email to