Hi Andy,

> On May 11, 2020, at 10:38 AM, Andy Seaborne <[email protected]> wrote:
> 
> 
> 
> On 11/05/2020 16:27, Chris Tomlinson wrote:
>> Darn it!!
>> When I use the correct parameter name it “works":
>> curl -s GET http://ldspdi-dev.bdrc.io/shapes/core/PersonShapes | curl -XPOST 
>> --data-binary @-  --header 'Content-type: text/turtle' 
>> 'http://host:port/fuseki/newcorerw/shacl?graph=http://purl.bdrc.io/graph/P707’
>> I just am not getting over seeing sh:conforms true when it seems like a 
>> third result should be present.
> 
> sh:conforms  true ;
> 
> will only appear if there are no violations.

I appreciate that it works that way but until and unless I can understand your 
point about

 [] sh:targetNode ex:myNode

then I don’t know how to distinguish: 1) no violations because a Person graph 
conforms to the PersonShapes - like there’s no Work indicated as a parent of 
the person or a rdfs:label is used where a skos:prefLabel is expected; versus 
2) no violations because the question is vacuous like asking if a Work looks 
like a person or an empty non-existent graph looks like a person. 

I understand that the shapes graphs in general are not exhaustive and that 
there certainly can be properties on a resource in the target graph that aren’t 
mentioned in the shapes graph; however, when developing shapes in particular it 
seems like knowing whether I’m getting conforms true simply because the shapes 
graph says nothing about the content of the data graph versus saying something 
true about the (part of) the target data graph.


>> I think I don’t get how to properly think of shacl validation.
> 
> A small illustration would help ...

When I request the endpoint to validate P707 as above, I get the same results 
as with the small standalone tests:

[ a            sh:ValidationReport ;
  sh:conforms  false ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"Node[NodeShape[http://purl.bdrc.io/ontology/shapes/core/MaleShape]] at 
focusNode <http://purl.bdrc.io/resource/P705>" ;
                 sh:resultPath                 bdo:hasFather ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:NodeConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-hasFather ;
                 sh:value                      bdr:P705
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/Person>]: Expected class 
:<http://purl.bdrc.io/ontology/core/Person> for 
<http://purl.bdrc.io/resource/P705>" ;
                 sh:resultPath                 bdo:hasParent ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-hasParent ;
                 sh:value                      bdr:P705
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/Person>]: Expected class 
:<http://purl.bdrc.io/ontology/core/Person> for 
<http://purl.bdrc.io/resource/P705>" ;
                 sh:resultPath                 bdo:kinWith ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-kinWith ;
                 sh:value                      bdr:P705
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/Gender>]: Expected class 
:<http://purl.bdrc.io/ontology/core/Gender> for 
<http://purl.bdrc.io/resource/GenderMale>" ;
                 sh:resultPath                 bdo:personGender ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-gender ;
                 sh:value                      bdr:GenderMale
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/Person>]: Expected class 
:<http://purl.bdrc.io/ontology/core/Person> for 
<http://purl.bdrc.io/resource/P705>" ;
                 sh:resultPath                 bdo:personStudentOf ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-personStudentOf ;
                 sh:value                      bdr:P705
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/PersonEvent>]: Expected 
class :<http://purl.bdrc.io/ontology/core/PersonEvent> for 
<http://purl.bdrc.io/resource/EVD4758367CFC1276C>" ;
                 sh:resultPath                 bdo:personEvent ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-personEvent ;
                 sh:value                      bdr:EVD4758367CFC1276C
               ] ;
  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/PersonEvent>]: Expected 
class :<http://purl.bdrc.io/ontology/core/PersonEvent> for 
<http://purl.bdrc.io/resource/EVFD910DBE53BCE208>" ;
                 sh:resultPath                 bdo:personEvent ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-personEvent ;
                 sh:value                      bdr:EVFD910DBE53BCE208
               ]
] .

These results make sense in the context of just the 
http://purl.bdrc.io/graph/P707 <http://purl.bdrc.io/graph/P707> because there 
are no triples about P705 present in the P707 graph, they’re in their own 
http://purl.bdrc.io/graph/P705 <http://purl.bdrc.io/graph/P705> graph; and 
there are some triples from the http://purl.bdrc.io/graph/ontologySchema 
<http://purl.bdrc.io/graph/ontologySchema> that are needed to make sense of 
birth and death events as subclasses of bdo:Event.

What I had hoped and would like to achieve is to validate P707 in the context 
of the dataset union graph where the needed triples are present. Something like 
what I get if I add just the needed triples to the P707 graph. Something like I 
think validate node would work rather than ?graph=union which presumably would 
attempt to validate everything in the entire dataset against the offered Shapes 
graph.

There is one result above that I’m not sure of from the report:

  sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  bdr:P707 ;
                 sh:resultMessage              
"ClassConstraint[<http://purl.bdrc.io/ontology/core/Gender>]: Expected class 
:<http://purl.bdrc.io/ontology/core/Gender> for 
<http://purl.bdrc.io/resource/GenderMale>" ;
                 sh:resultPath                 bdo:personGender ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:ClassConstraintComponent ;
                 sh:sourceShape                bds:PersonShape-gender ;
                 sh:value                      bdr:GenderMale
               ] ;

but I think this is coming from the requirement that P705 must be of 
bdr:GenderMale in order to be the father of P707, although it isn’t clear from 
the sh:resultMessage.

Thank youj,
Chris




Reply via email to