Question on sh:values

39 views
Skip to first unread message

Felix Sasaki

unread,
Nov 21, 2021, 5:49:03 AM11/21/21
to TopBraid Suite Users
I am trying the sh:values feature
with the shacl api
using the example attached. 

Doing an inference, I get the triples generated as expected:

<http://example.com/instancedata/JohnKennedy> <http://schema.org/children>  <http://example.com/instancedata/CarolineKennedy> , <http://example.com/instancedata/PatrickBKennedy> , <http://example.com/instancedata/JohnKennedyJr> . 


Trying validation, I get an error message for JohnKennedy:
 sh:result    [ a                             sh:ValidationResult ;
                 sh:focusNode                  kennedys:JohnKennedy ;
                 sh:resultMessage              "Property needs to have at least 3 values, but found 0" ;
                 sh:resultPath                 schema:children ;
                 sh:resultSeverity             sh:Violation ;
                 sh:sourceConstraintComponent  sh:MinCountConstraintComponent ;
                 sh:sourceShape                _:b0               ] ;


I would have expected that the validation takes the triples into account that have been generated via sh:values. Is this wrong, or is there an issue with my SHACL example?

Best

Felix
sh-values-input-data.ttl

Holger Knublauch

unread,
Nov 21, 2021, 5:07:04 PM11/21/21
to topbrai...@googlegroups.com

By default, SHACL will not apply any inferences before validation. If you first want to run the (sh:values) rules, try setting the sh:entailment property

    https://www.w3.org/TR/shacl/#shacl-rdfs

at some subject (typically the owl:Ontology instance of your graph) with the value sh:Rules

    https://w3c.github.io/shacl/shacl-af/#Rules

HTH
Holger

--
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 topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/13168e8c-035f-4098-b572-3faa651a8a04n%40googlegroups.com.

Felix Sasaki

unread,
Nov 22, 2021, 2:33:12 AM11/22/21
to topbrai...@googlegroups.com
Thanks a lot, Holger, that worked.

Best

Felix

Reply all
Reply to author
Forward
0 new messages