Hi,
While trying to familiarize myself with sh:values in EDG, I fail to get the results I think I expect using sh:prefixes. I’ve read the spec and Holger’s mail dd March 22 2021 on this topic in this forum.
In TopBraid Examples Geo Ontology, I added a values property shape to g:GeoConcept that counts the number of narrowers, see [1]. It works as expected.
But I had to use sh:prefixes as in [2], with the urn-URI. When using the “external graph URI” as the graphURI as in [3], the prefix declaration is not found, even though I did set this parameter on the settings tab, as seen under [4].
The external graphURI is to be used as value of owl:imports*, so I would expect [3] to work, or is this by design? -j
[1]

[2]
g:GeoConcept-numberOfNarrowers
a sh:PropertyShape ;
sh:path g:numberOfNarrowers ;
sh:datatype xsd:integer ;
sh:maxCount 1 ;
sh:name "number of narrowers" ;
sh:values [
sh:prefixes <urn:x-evn-master:geography_ontology> ;
sh:select """
SELECT COUNT(?n)
WHERE {
?n skos:broader ?this .
}
""" ;
] ;
.
[3]
sh:prefixes <http://topquadrant.com/ns/examples/geography#> ;
or
sh:prefixes g: ;
[4]
<urn:x-evn-master:geography_ontology>
a owl:Ontology ;
metadata:status metadata:UnderDevelopmentStatus ;
swa:defaultNamespace http://topquadrant.com/ns/examples/geography# ;
teamwork:externalGraphURI g: ;
rdfs:comment "Schema definition for Geography Taxonomy." ;
rdfs:label "TopBraid Examples Geo Ontology" ;
owl:imports http://datashapes.org/dash ;
owl:imports http://datashapes.org/graphql ;
owl:imports http://spinrdf.org/spl ;
owl:imports http://topbraid.org/skos-xl.shapes ;
owl:imports http://topbraid.org/skos.shapes ;
owl:imports http://topbraid.org/tbgeo ;
owl:imports http://topbraid.org/teamworkconstraints ;
sh:declare [
sh:namespace http://topquadrant.com/ns/examples/geography#^^xsd:anyURI ;
sh:prefix "g" ;
] ;
sh:declare [
sh:namespace http://www.w3.org/2004/02/skos/core#^^xsd:anyURI ;
sh:prefix "skos" ;
] ;
sh:declare [
sh:namespace http://www.wikidata.org/prop/direct/^^xsd:anyURI ;
sh:prefix "wdt" ;
] ;
.
Jan Voskuil | CEO Taxonic
Veldzigt 2, 3454 PW, De Meern, The Netherlands
T +31 (0)88 829 66 00 | M:+31 (0)6 14488335
jan.v...@taxonic.com | www.taxonic.com
Registered office in Den Haag, The Netherlands
Registration Number Chamber of Commerce: 54529190
On Jun 1, 2021, at 4:39 AM, Jan Voskuil <jan.v...@taxonic.com> wrote:Hi,While trying to familiarize myself with sh:values in EDG, I fail to get the results I think I expect using sh:prefixes. I’ve read the spec and Holger’s mail dd March 22 2021 on this topic in this forum.In TopBraid Examples Geo Ontology, I added a values property shape to g:GeoConcept that counts the number of narrowers, see [1]. It works as expected.But I had to use sh:prefixes as in [2], with the urn-URI. When using the “external graph URI” as the graphURI as in [3], the prefix declaration is not found, even though I did set this parameter on the settings tab, as seen under [4].The external graphURI is to be used as value of owl:imports*, so I would expect [3] to work, or is this by design? -j
[1]<image002.png>
--
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/AM0PR03MB37457F535B94C01BE60F12B9E93E9%40AM0PR03MB3745.eurprd03.prod.outlook.com.
Yes, and the underlying issue is that sh:prefixes will follow the owl:imports closure but while editing in EDG those owl:imports will be attached to the Home resource urn:x-evn-master:XY which is different from the external namespace resource. You could theoretically declare your prefixes at the external graph URI
ex:MyGraph
a owl:Ontology ;
owl:imports <http://datashapes.org/dash> ;
sh:declare [ ... ]
.
and then do sh:prefixes ex:MyGraph in your SPARQL query.
In either case, this is a common pain point for SHACL users that
unfortunately was required because RDF graphs do not have a
concept of prefixes (which are an aspect of the serialization
only), yet SHACL is serialization-agnostic.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/2FBA4796-A717-49CA-B3BB-4ADA23E4DE54%40topquadrant.com.
Thanks Irene, very useful, -j
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/2FBA4796-A717-49CA-B3BB-4ADA23E4DE54%40topquadrant.com.