SHACL and existing models

79 views
Skip to first unread message

Jack Hodges

unread,
Jul 11, 2016, 7:47:07 PM7/11/16
to TopBraid Suite Users
All of the tutorial and help contents I have seen to date, regarding SHACL, suggest that one should build models from scratch using the SHACL 'api'. This is just not realistic. I can easily go into my models and add an sh:Shape rdf:type but I wouldn't want to recreate models as Shapes files. Is this a requirement and, if so, can you please explain why?

Jack

Holger Knublauch

unread,
Jul 11, 2016, 8:45:56 PM7/11/16
to topbrai...@googlegroups.com
Hi Jack,

the idea is that people can use SHACL incrementally with existing RDF or OWL files. The next release has some convenience features for that - a one-click button that turns any class into a "SHACL-enabled" class (with the rdf:type sh:Shape triple and the correct owl:imports). Meanwhile, you can do this "by hand", assuming you have the SHACL namespace imported and the rdf:type triple added.

If the tutorial material so far is giving you the impression that models need to be build from scratch then this would be a major problem with the tutorials. Could you point me at specific places where you got that impression from?

Also, what specifically are you trying to avoid - is adding the sh:Shape triple the issue?

Having said this, different design patterns will emerge with SHACL. Some people may indeed start from scratch and duplicate all their classes with shapes. Others may put the SHACL related triples into other files/graphs.

Holger



On 12/07/2016 9:47, Jack Hodges wrote:
All of the tutorial and help contents I have seen to date, regarding SHACL, suggest that one should build models from scratch using the SHACL 'api'. This is just not realistic. I can easily go into my models and add an sh:Shape rdf:type but I wouldn't want to recreate models as Shapes files. Is this a requirement and, if so, can you please explain why?

Jack
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
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.
For more options, visit https://groups.google.com/d/optout.

Jack Hodges

unread,
Jul 13, 2016, 7:10:30 PM7/13/16
to TopBraid Suite Users
Holger,

I did do it by hand and it worked just fine (insomuch as I understand what I am doing). I 'was' under the impression from the documentation that it should be done by starting from scratch. I got that idea just from the way the tutorial starts. All that would be required to eliminate that possible interpretation would be to add the following after this sentence "Let's start by creating a new SHACL file with a classical data model about Persons and family relationships.": "This following discussion could also be applied to an existing class (see turtle source for imports and prefix examples)".

On another question, at the bottom of the tutorial there is a section called "Further Topics" that includes, among other things, "Complex constraints can be expressed in SPARQL". Although I find datatype and property constraint templates immensely useful, my very first SHACL example uses a SPARQL constraint. I have tested the SPARQL constraint and it works but I cannot really tell if it works when I migrate it to SHACL syntax/semantics. I remember reading somewhere that SHACL-based SPARQL queries had to have an ORDER BY clause but the SHACL SPARQL constraints examples from the W3C document do not have ORDER BY clauses. For something as important as SPARQL I would hope that a future version of the tutorial would include a working SPARQL example.

It would also be nice to have a discussion of the sh:message property and how to maximize its value.

Jack

Holger Knublauch

unread,
Jul 13, 2016, 8:22:04 PM7/13/16
to topbrai...@googlegroups.com


On 14/07/2016 9:10, Jack Hodges wrote:
Holger,

I did do it by hand and it worked just fine (insomuch as I understand what I am doing). I 'was' under the impression from the documentation that it should be done by starting from scratch. I got that idea just from the way the tutorial starts. All that would be required to eliminate that possible interpretation would be to add the following after this sentence "Let's start by creating a new SHACL file with a classical data model about Persons and family relationships.": "This following discussion could also be applied to an existing class (see turtle source for imports and prefix examples)".

Thanks, I have updated the page along those lines.



On another question, at the bottom of the tutorial there is a section called "Further Topics" that includes, among other things, "Complex constraints can be expressed in SPARQL". Although I find datatype and property constraint templates immensely useful, my very first SHACL example uses a SPARQL constraint. I have tested the SPARQL constraint and it works but I cannot really tell if it works when I migrate it to SHACL syntax/semantics. I remember reading somewhere that SHACL-based SPARQL queries had to have an ORDER BY clause but the SHACL SPARQL constraints examples from the W3C document do not have ORDER BY clauses. For something as important as SPARQL I would hope that a future version of the tutorial would include a working SPARQL example.

You are absolutely right, but my dilemma is that there is a mismatch between the current W3C draft and what's in the 5.1 release right now. So whatever I describe would be outdated and potentially just add to the confusion. The syntax of SPARQL constraints has changed quite a bit (was: sh:constraint/sh:sparql, now: sh:sparql/sh:select). I am carefully optimistic that by the time 5.2 comes out, the spec will have sufficiently stabilized that we can then invest more time on a number of tutorials to help jumpstart the community. Meanwhile, I am here to answer specific questions that you may have.



It would also be nice to have a discussion of the sh:message property and how to maximize its value.

What is unclear?

Cheers,
Holger
Reply all
Reply to author
Forward
0 new messages