Is it possible to define a pattern to sh: path values?

17 views
Skip to first unread message

Angelo Frozza

unread,
Aug 27, 2020, 11:12:14 AM8/27/20
to TopBraid Suite Users
Hi all,

I want to know if SHACL allows defining a pattern for values in the  sh:path element, for example, something like:

  sh:property [
       sh:path ex:name??? ;
       sh:node xsd:string;
    ].
Where the part "???"  is dynamic.

This property could validate data graphs as:

ex:name01 "John"; #OK
ex:name02 "Mary; #OK
ex:name03 120;    #ERR

Hugs,

Angelo

Irene Polikoff

unread,
Aug 27, 2020, 11:18:32 AM8/27/20
to topbrai...@googlegroups.com
Typically, you would define a property shape for each of the properties.
 It would not be sh:node xsd:string, but rather sh:datatype xsd:string.

Values of sh:path are specified here: https://www.w3.org/TR/shacl/#property-paths

--
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/b1635683-c6f5-4991-a69e-9e1c1d56203dn%40googlegroups.com.

Holger Knublauch

unread,
Aug 27, 2020, 6:00:19 PM8/27/20
to topbrai...@googlegroups.com

The short answer is no, sh:paths cannot be dynamic. Your use case can be covered by SHACL-SPARQL though.

Holger

Angelo Frozza

unread,
Aug 27, 2020, 6:17:51 PM8/27/20
to topbrai...@googlegroups.com
Thank you Holger and Irene,

Irene, you are correct, this line I posted wrong:
>>        sh:node xsd:string;

Hugs,
Angelo



--

-----
Prof. Angelo Augusto Frozza, M.Sc.
Doutorando PPGCC/UFSC

Professor EBTT
IFC - Instituto Federal Catarinense - Campus Camboriú
http://about.me/tilfrozza

Sugestões de leitura:

Reply all
Reply to author
Forward
0 new messages