Does sh:severity sh:Info not work with SPARQLConstraints in a NodeShape?

25 views
Skip to first unread message

Steve Ray

unread,
Jul 13, 2023, 4:33:58 PM7/13/23
to TopBraid Suite Users
I am successfully using sh:Info inside PropertyShapes with SPARQLConstraints, but the particular constraint I'm working on is for any property, so I am using a NodeShape. 

I have tried specifying sh:Info, but TBC-ME keeps showing my violating SPARQLConstraint as a full-on violation rather than an sh:Info.

Sample code pattern:
ex:MyClass
sh:sparql [
a sh:SPARQLConstraint ;
sh:message "My message" ;
sh:severity sh:Info ;
sh:prefixes <http://relevantURI> ;
sh:select """
SELECT $this ...
WHERE {
...
""" ;
] ;

MyClass is defined elsewhere as a sh:NodeShape
MyClass has several SPARQLConstraints, so I want this one to be sh:Info and the other one to be the default (sh:Violation).

What am I doing wrong?

Steve


Holger Knublauch

unread,
Jul 13, 2023, 4:42:47 PM7/13/23
to topbrai...@googlegroups.com
Have you tried attaching the sh:severity to the surrounding shape/class? That should do it. If you don’t want to put it into the class itself, you could create an in-between node shape and link it to the class using sh:node.

Holger


--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@googlegroups.com
---
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/CAGUep85YJy_CkvWGWcpfi9YeTMXCLrBuvrJbO8o-BkXJH7%2B18w%40mail.gmail.com.

Steve Ray

unread,
Jul 14, 2023, 2:24:40 PM7/14/23
to topbrai...@googlegroups.com
Thanks for the push in the right direction. I ran into problems attaching it to MyClass using sh:node, but it worked properly by defining a shape and using sh:targetClass.

It kept the other constraint as a violation, and my new constraint as sh:Info.


Steve




Reply all
Reply to author
Forward
0 new messages