Hi Julie,
I assume you want to instantiate sh:SPARQLRule
https://w3c.github.io/shacl/shacl-af/#SPARQLRule
and link a class/shape with that rule using sh:rule. sh:sparql is used
for constraints, not inference rules.
You can see an example of this in the datacube.shapes.ttl file:
qb:ComponentPropertyRuleShape
a sh:NodeShape ;
rdfs:comment "A SHACL rule that can be used to infer additional
triples that copies all values of the sub-properties of
qb:componentProperty into qb:componentProperty itself. This is needed
because many constraints here only reference qb:componentProperty." ;
sh:rule [
a sh:SPARQLRule ;
sh:construct """CONSTRUCT {
?subject qb:componentProperty ?object .
}
WHERE {
?subject qb:attribute|qb:dimension|qb:measure|qb:measureDimension
?object .
}""" ;
sh:order 0 ;
sh:prefixes <http://topbraid.org/datacube> ;
] ;
sh:targetNode sh:this ;
.
and many more in the file owl2shacl.ttl
One area where every newcomer seems to trip over is how to use
sh:prefixes. To get started and keep it simple you may want to just
place them as PREFIX declarations into each rule. Otherwise,
https://www.w3.org/TR/shacl/#sparql-prefixes
Holger
On 2021-11-06 9:52 am, Julie Budaher wrote:
Hi,
Sorry for the basic question , but I am eventually new to this domain.
I am confused about the difference between a sparql query and a sparql
constraint that is added in order to inference new triples. I have
sparql queries that I need to put them in the form of shacl rules in
order to make inference, and when I add the sparql query in sh:sparql,
I am getting an error saying:Error: value must be an instance of
sparql constraint. Can someone explain to me, please, how can I use
these sparql queries as sparql constraints ? Thank you in advance
--
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/530d8d3e-0dec-40c0-bd01-ead87639f57fn%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/530d8d3e-0dec-40c0-bd01-ead87639f57fn%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/205f6122-2450-26ee-519f-b8588ee08396%40topquadrant.com.