--
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/CAGUep85Rf1yk3YVsLV3ihJjso7w5uF%2BBGqFOSpPWybBCuGw6nQ%40mail.gmail.com.
<epp1.shapes.ttl><epp2.shapes.ttl>
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/159328BE-4286-447E-BDA7-0827C564A2E3%40topquadrant.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/159328BE-4286-447E-BDA7-0827C564A2E3%40topquadrant.com.
In your first example, add
sh:rule [
a sh:SPARQLRule ;
sh:prefixes
<http://data.ashrae.org/standard223/1.0/inference/owl-subset>
;
because
<http://data.ashrae.org/standard223/1.0/inference/owl-subset>
sh:declare [
sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ;
sh:prefix "owl" ;
] .
is already a correct prefix declaration.
If you attempt something like in your second example:
sh:prefixes <http://www.w3.org/2002/07/owl> ;
then the assumption is that the following triples are present
sh:declare [
sh:namespace "http://www.w3.org/2002/07/owl#"^^xsd:anyURI ;
sh:prefix "owl" ;
] .
which they are not.
There is clear evidence that too many people struggle with this aspect of the SHACL spec, and that as an editor I should have done a better job there. If I could simply re-upload the SHACL spec this would be the first thing to fix. However, the formal W3C process doesn't allow this easily.
I have to admit I never liked to even have the need to declare those namespaces as triples - this is a mixed blessing because nobody seems to understand the syntax yet namespace prefixes are a serialization concept only, not a graph concept. At some stage I may just give up on this and change our SHACL engine to simply add the declared prefixes from the files, like SPIN did for pragmatic reasons, ignoring the spec.
BTW both examples have a mismatch between the baseURI and the
owl:Ontology. I suggest to keep them aligned.
HTH
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/e0633424-2ad7-12b8-e035-fd553f0e92ed%40topquadrant.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/e0633424-2ad7-12b8-e035-fd553f0e92ed%40topquadrant.com.
I think the light bulb just went on.
Are you saying that the natural language interpretation of the sh:prefixes triple inside a SPARQLRule is:
"Go to the following graph URI to get the definitions for the prefixes you will need in the SPARQL query"...
...and in the ontology declaration, you use the sh:declare to do those definitions. (without wrapping those sh:declare statements inside a sh:prefixes clause)?
Yes exactly. The idea is that each graph declares its "main" prefix and then includes the other prefixes that it needs via owl:imports. Since the owl:imports are found at the graph URI resource, this was a natural place to attach this info to, without too much redundancy. Anyone who owl:imports your graph can then use its own owl:Ontology and will get the other prefix declarations automatically.
A problem is that this one example in the SHACL spec
https://www.w3.org/TR/shacl/#sparql-constraints-example
doesn't include the triples behind ex: and most readers will not scroll down to
https://www.w3.org/TR/shacl/#sparql-prefixes
for the full picture.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep85BWQbeqdh35OGKrqcmG13TbTo%3DD7Or-QsVOQoFq61PUA%40mail.gmail.com.
sh:prefixes ex: ; sh:select """
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/8e829632-e471-b342-a957-b9b49c5c0ca8%40topquadrant.com.
On 2021-03-24 8:48 am, Steve Ray wrote:
Also, the ambiguity in the example is that ex: represents both a prefix found in the SPARQL query and also represents the URI for the ontology in which the prefixes are defined. I had interpreted the example at https://www.w3.org/TR/shacl/#sparql-constraints-example to mean "Identify all the prefixes you need in the query here" rather than "go to this URI to find all the prefix definitions".
Also, by the way, I have never succeeded in using the prefix as in your example at https://www.w3.org/TR/shacl/#sparql-constraints-example . In your example you saysh:prefixes ex: ; sh:select """I have only gotten it to work when I expand ex: to the full URI. I wondered whether it was because the ex: turns into http://example.com/ns# and when I spell it out I don't include the #, rather I write <http://example.com/ns>.
Yes this is easy to get wrong. URLs ending with # are often used without the # for the base URI/owl:Ontology. This problem doesn't exist for namespaces ending with /
So regardless of the namespace, you typically want to reference the *base URI* (aka named graph) which is where the owl:Ontology is. In the SHACL spec's example that base URI and namespace are identical and both end with the #. However, if you had
<http://example.com/ns>
a owl:Ontology ;
sh:declare ...
then you would use sh:prefixes <http://example.com/ns> without the hash. For the examples and the SHACL namespace itself we chose to use a # URL both for the namespace and the graph URI.
(These are very recurring questions not only from you, which
indicates that there is a deeper design problem with this aspect
of the RDF world).
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAGUep84OsS4puuF3e9UM2k8sR5Eg9b_MvVGb1Eh9Ks%2Bj5-rbQQ%40mail.gmail.com.