Hi Richard (or others),

I am currently playing around with these shape constraints and I noticed 
that while it is stated in the shape the property 'b_has_result' has to 
occur at least one time (minCount 1) it does not raise an error if the 
property is absent.
Once the property occurs one time however, it raises the error that is 
should be the same to 'a_has_result' so that seems to work, but when I 
tried to add another instance for b (instance_b_2), something like:

test:instance_b_2
  rdf:type test:b ;
  test:notes "this instance should also be equal to a_has_result" ;
  test:b_has_result test:test_result ;
  rdfs:label "instance_b_2" ;
.

it results in the error Value does not have shape derived_data_well_shape. 
While 
it is exactly the same instance as 'instance_b' besides the different 
labeling.
Do I have to adjust the CompleteResultShape somehow??


Op donderdag 19 september 2019 12:09:01 UTC+2 schreef Richard Cyganiak:
>
> You could amend the property shapes for a_has_result and b_has_result and 
> set their sh:node to something like test:CompleteResultShape. The intention 
> being that the result of any instance of a or b needs to have that shape.
>
> Then define a new NodeShape test:CompleteResultShape that has two property 
> constraints with sh:inversePaths; one for a_has_result and one for 
> b_has_result; both with a minCount of 1. This would mean a result only has 
> the shape test:CompleteResultShape if it has an incoming edge from both an 
> instance of a and an instance of b.
>
> As an effect, if there is any instance of a whose result isn't also the 
> result of an instance of b, then there would be a validation error. I think 
> that's what you want.
>
> So, something like:
>
> test:CompleteResultShape
>   rdf:type sh:NodeShape ;
>   sh:property [
>       sh:path [
>           sh:inversePath test:a_has_result ;
>         ] ;
>       sh:maxCount 1 ;
>       sh:minCount 1 ;
>     ] ;
>   sh:property [
>       sh:path [
>           sh:inversePath test:b_has_result ;
>         ] ;
>       sh:maxCount 1 ;
>       sh:minCount 1 ;
>     ] ;
> .
> test:a
>   rdf:type owl:Class ;
>   rdf:type sh:NodeShape ;
>   rdfs:label "a" ;
>   sh:property [
>       rdf:type sh:PropertyShape ;
>       sh:path test:aHasResult ;
>       sh:class test:Result ;
>       sh:name "a has result" ;
>       sh:node shacl-test:CompleteResultShape ;
>     ] ;
> .
>
> And similarly for test:b.
>
> Richard
>
>
> On 19 Sep 2019, at 10:05, Stefan Verweij <[email protected] <javascript:>> 
> wrote:
>
> Thanks for clarifying, is what I want even possible?
>
> Op donderdag 19 september 2019 11:00:44 UTC+2 schreef Richard Cyganiak:
>>
>> Stefan,
>>
>> sh:equals requires that two properties of the same instance have the same 
>> values.
>>
>> What you want is two properties of two different instances having the 
>> same values.
>>
>> Richard
>>
>
> -- 
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/699bc7d2-f4f3-415f-84c1-ae7556e26b3b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/699bc7d2-f4f3-415f-84c1-ae7556e26b3b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
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/b9e9f516-4448-4ded-96c2-373a40cfbf1b%40googlegroups.com.

Reply via email to