admin管理员组文章数量:1123887
I'm trying to identify a method, in SHACL, where the following SPARQL query is evaluated live at validation and is used as an input to an sh:in rule
PREFIX wdt: </>
PREFIX wd: </>
SELECT
?country
WHERE {
SERVICE <; {
?country wdt:P31 wd:Q3624078 }
}
I've envisioned the following SHACL rule:
ex:InExampleShape
a sh:NodeShape ;
sh:targetNode ex:Person ;
sh:property [
sh:path ex:bornIn ;
sh:in ex:DYNAMIC_COUNTRY_LIST_FROM_WIKIDATA ;
] .
Probably turning the SPARQL SELECT query into a CONSTRUCT that returns a proper rdf:List is the first challenge here.
I've also considered using SHACL SPARQL-based constraints but the SERVICE keyword is explicitly disallowed (for good reasons). I've also been wondering if a SPIN (/) Construct query could do the job.
I'm trying to identify a method, in SHACL, where the following SPARQL query is evaluated live at validation and is used as an input to an sh:in rule
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT
?country
WHERE {
SERVICE <https://query.wikidata.org/sparql> {
?country wdt:P31 wd:Q3624078 }
}
I've envisioned the following SHACL rule:
ex:InExampleShape
a sh:NodeShape ;
sh:targetNode ex:Person ;
sh:property [
sh:path ex:bornIn ;
sh:in ex:DYNAMIC_COUNTRY_LIST_FROM_WIKIDATA ;
] .
Probably turning the SPARQL SELECT query into a CONSTRUCT that returns a proper rdf:List is the first challenge here.
I've also considered using SHACL SPARQL-based constraints but the SERVICE keyword is explicitly disallowed (for good reasons). I've also been wondering if a SPIN (https://spinrdf.org/) Construct query could do the job.
Share Improve this question edited 15 hours ago thalhamm asked yesterday thalhammthalhamm 3472 silver badges6 bronze badges1 Answer
Reset to default 1As this is not supported by current SHACL standard versions, I assume you are open to discussing some SHACL extension?
This is what we support now in our product, for pretty much exactly your use case: https://datashapes.org/dynamic.html#example-state
本文标签: sparqlUse a dynamic list for SHACL39s shInConstraintComponent (shin)Stack Overflow
版权声明:本文标题:sparql - Use a dynamic list for SHACL's sh:InConstraintComponent (sh:in) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736604736a1945297.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论