Re: Constraints on a property in a SKOS hierarchy

On 2021-09-21 6:57 pm, felix@sasakiatcf.com wrote:
>
> Dear all,
>
> I would like to to the following:
>
>  1. Define a property “ex:myProperty” for a skos:Concept.
>  2. In a given SKOS taxonomy, the following constraint should be
>     formulated: for the taxonomy, the property should appear zero or
>     more times in one “branch” of the taxonomy.
>
If you really mean zero or more times, then this wouldn't constrain 
anything. My understanding is you want to say zero or one time, i.e. 
that there can be at most one value per branch?
>
> 1.
>
>
> The following would be a valid SKOS RDF graph:
>
> example:animal a skos:Concept; ex:myProperty “some value”.
>
> example:bird a skos:Concept; skos:broader example:animal.
>
> The following would be a non-valid SKOS RDF graph, since example:bird 
> is connected to another concept (example:animal) that already has 
> ex:myProperty:
>
> example:animal a skos:Concept; ex:myProperty “some value”.
>
> example:bird a skos:Concept; skos:broader example:animal; 
> ex:myProperty “some value”.
>
Given the above assumption, could this simply become a maxCount 1 on a 
path expression skos:broader* / ex:myProperty?

Untested draft:

ex:BranchShape
     a sh:NodeShape ;
     sh:targetSubjectsOf ex:myProperty ;
     sh:property [
         sh:path ( [ sh:zeroOrMorePath skos:broader ] ex:myProperty ) ;
         sh:maxCount 1 ;
     ] .

I guess instead of the sh:targetSubjectsOf you could also simply attach 
this to all skos:Concepts.

Holger


> How would I formulate 2) in SHACL?
>
> Regards
>
> Felix
>

Received on Wednesday, 22 September 2021 00:14:41 UTC