Hi,
I would like to display variables of the SPARQL select query in the sh:message like specified in the SHACL documentation: https://www.w3.org/TR/shacl/#sparql-constraints-variables. Unfortunately, it does not work like expected.
How can I display variables of the SPARQL select query in the sh:message?
Thank you for the support.
Example SHACL:
maic:RuleShapeI rdf:type owl:NamedIndividual , sh:NodeShape ;
sh:sparql [
rdf:type sh:SPARQLConstraint ;
sh:message "{$this} is a teacher of {?student}." ;
sh:prefixes [
sh:declare [
sh:namespace "http://www.semanticweb.org/anyNamespace"^^xsd:anyURI ;
sh:prefix "maic"
]
] ;
sh:select """
SELECT $this ?student
WHERE {
$this maic:teaches ?student
}"""
] ;
sh:targetClass maic:Teacher ;
sh:severity sh:Info ;
.
Example validation report:
sh:resultMessage "{$this} is a teacher of {?student}." .
Expected validation report:
sh:resultMessage "Anna is a teacher of Boris." .