IRI match pattern in SHACL

12 views
Skip to first unread message

Simon Cox

unread,
Jun 9, 2020, 3:04:44 AM6/9/20
to TopBraid Suite Users
Is it possible in SHACL to test if an IRI matches a pattern (e.g. contains a substring). `sh:pattern` is restricted to string-literals. In SPARQL you can cast an IRI to a string to manipulate or match it. Is there a native way in SHACL to do this? 

Holger Knublauch

unread,
Jun 9, 2020, 3:15:27 AM6/9/20
to topbrai...@googlegroups.com


On 9/06/2020 17:04, Simon Cox wrote:
Is it possible in SHACL to test if an IRI matches a pattern (e.g. contains a substring). `sh:pattern` is restricted to string-literals.

sh:pattern should work. See https://www.w3.org/TR/shacl/#PatternConstraintComponent it uses the equivalent of the str(?valueNode) function so it will convert URI nodes to strings before applying the regex.

Holger


In SPARQL you can cast an IRI to a string to manipulate or match it. Is there a native way in SHACL to do this? 
--
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/69e03c16-9790-4d44-98ba-b5ca0b9cefado%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages