Hi Steve,
it SHOULD work, but TBC has two validation buttons and only the green one includes the classes and properties:

I'm not understanding something about validating SHACL files. Normally I successfully use shapes and SPARQLConstraints to validate rdf instance files, but I'd also like to apply some constraints to our SHACL shape definitions themselves.
For example, I'd like to ensure all our declared classes/Nodeshapes have an rdfs:label, so I wrote:
owl:Classsh:property [sh:path rdfs:label ;sh:minCount 1 ;] ;.
On the above, please double-check that owl:Class rdf:type
sh:NodeShape is also asserted.
Holger
I also tried1. Writing a SPARQLConstraint to do the same thing.2. Using the sh:targetClass method with an explicitly named shape.3. Using these with sh:NodeShape instead of owl:Class, since all my classes are also instances of sh:NodeShape.
None produced any validation errors when I ran the TBC validator on a shapes file containing the definition of a class where I intentionally omitted an rdfs:label value.
I know that the SHACL spec even has the shsh:ShapeShape specification, so I assume this kind of thing can be done. Is something blocking the validation error from showing up? Is it because rdfs:label is an annotation property?
Steve
--
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/CAGUep87sNoHp7PQaJq9bVsODsOL7OY1Q-%2B9LBDooJtC1tBWBCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/e3dba027-2908-89d8-c930-7abf03361868%40topquadrant.com.
On 23 Oct 2021, at 3:50 am, Steve Ray <st...@steveray.com> wrote:Holger,Your final suggestion was the key! Who knew that we must declare owl:Class to be of type sh:NodeShape!I had a similar validation test for labelling all properties, and declaring rdf:Property as rdf:type sh:NodeShape fixed that one as well.Thank you so much for that subtle tip. If this is documented in the SHACL spec, I missed it. If it is not, I'll bet other people will bump into this problem.
Steve
On Thu, Oct 21, 2021 at 6:18 PM Holger Knublauch <hol...@topquadrant.com> wrote:
Hi Steve,
it SHOULD work, but TBC has two validation buttons and only the green one includes the classes and properties:
<3HjnsEUcNN3NjWZm.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep851gHoMy%2BVCgYnTTSfXG54aoy16O9HxkH0j3BrsjtUFRA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/441BC0AB-3266-45AE-B94E-52906C004FAB%40topquadrant.com.
I now understand.
On a related point, is it true that the only owl uses that persist in SHACL implementations are the two relating to managing graphs:
owl:imports (if you want to import other graphs), and
X a owl:Ontology (if you want to name a graph so that you can do things like imports)?
This type triple is not necessary. You only need to use a URI that is equivalent to the named graph, e.g.
<http://example.org/myShapesGraph> owl:imports <http://datashapes.org/dash>
is sufficient. The owl:Ontology type is typically given though as
a helpful annotation, e.g. to inform form builders.
Do you endorse the use of owl property declarations, e.g. Y a owl:ObjectProperty, etc., or do you recommend enforcing the implications of those with SHACL shapes? If the latter, are there SHACL definitions for those?
There is no need for owl:ObjectProperty or any other global property triples, but they don't do harm either. A pure SHACL implementation takes a rather object-oriented worldview where all property declarations are attached to classes/shapes, and do not really live on their own.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep84zfGuiY1cGyzpfY7ftv12wphNEY_N6pZc0pNociS0q2w%40mail.gmail.com.
On Oct 22, 2021, at 7:54 PM, Steve Ray <st...@steveray.com> wrote:I now understand.On a related point, is it true that the only owl uses that persist in SHACL implementations are the two relating to managing graphs:owl:imports (if you want to import other graphs), and
X a owl:Ontology (if you want to name a graph so that you can do things like imports)?
Do you endorse the use of owl property declarations, e.g. Y a owl:ObjectProperty, etc., or do you recommend enforcing the implications of those with SHACL shapes? If the latter, are there SHACL definitions for those?
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep84zfGuiY1cGyzpfY7ftv12wphNEY_N6pZc0pNociS0q2w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/F4E1CA10-DE55-4375-8BDE-09E17D4FF4AC%40topquadrant.com.
Thanks Holger and Irene for this perspective.
Regarding properties, are you saying I should just declare all my properties to be of type rdf:Property? I'm reluctant to just have them all embedded inside property shapes, just for clarity.
Also, I have written SHACL rules to infer reverse triples for owl:SymmetricProperty and owl:InverseProperty declarations, but I suppose I could declare them as myNamespace:SymmetricProperty and myNamespace:InverseProperty which could be subClassOf rdf:Property. Would that be best practice?
I assume you mean owl:inverseOf?
It is perfectly fine to use SHACL rules that react on the OWL vocabulary, e.g. owl:SymmetricProperty.
FYI there is also a SHACL constraint in the dash: namespace that serves not as inference but as a constraint
https://datashapes.org/constraints.html#SymmetricConstraintComponent
I don't like using owl:inverseOf and strongly discourage its use. sh:inversePath is sufficient and doesn't require the use of an (OWL) inference engine.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep85wifORPOZMHNPpDGSKzaNq94XkKnU3PJ4%2BwT5wRi5E%3Dg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/11a62a4b-5b45-ca90-70b4-b1a217cbeaed%40topquadrant.com.
ex:MyRandomClass
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf owl:Thing ;
rdf:type owl:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf owl:Thing ;
myNamespace:Class
rdf:type rdfs:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf rdfs:Class ;
ex:MyRandomClass
rdf:type myNamespace:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf myNamespace:MyRootClass ;
rdf:type myNamespace:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf rdfs:Class ;
or should it be:
rdf:type myNamespace:Class ;
rdf:type sh:NodeShape ;
rdfs:subClassOf rdfs:Resource ;
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/11a62a4b-5b45-ca90-70b4-b1a217cbeaed%40topquadrant.com.
On 28 Oct 2021, at 19:33, Steve Ray <st...@steveray.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep85%3DV-uMyv7AarX%3D0TPFDqeKA4bZ%2Bc7LN_6HnAFvVh2N9g%40mail.gmail.com.
This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. TNO accepts no liability for the content of this e-mail, for the manner in which you use it and for damage of any kind resulting from the risks inherent to the electronic transmission of messages.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep84WPfeun1WiW_z9QkTYD-WHzeywnVS_J8K_1XFyc25bxA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep85%3DV-uMyv7AarX%3D0TPFDqeKA4bZ%2Bc7LN_6HnAFvVh2N9g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/5A6EB7D4-97BD-452A-9835-10F252C0428D%40topquadrant.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/eb2b6be1-f9c3-4539-b006-9d1da7fff7df%40email.android.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/9b6a7357-afd4-4918-b00a-c34c4b334323%40email.android.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/EB31B941-9D83-4CA3-8FA8-5D091902D078%40topquadrant.com.
Ok see your point.
Then name “Class” is misleading.
It’s a meta class that can better have a more specific name like “MyClass” or MyDefinedClass or LocalClass ..etc.
In my cen standard we have a similar “ConceptType” metaclass that can be used for that.
Slight diff.: classification towards that class is optional in my case where it might be always classified (for all your defined classes) in your case.
Greetings Michel
| ||||||||
| ||||||||
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep85WtpyZ2u_CT2q%3DC6OXcrn6ThZRqHAfs6Yf0cy9wjJ-WA%40mail.gmail.com.