query-cad4bfb80e6e989d7f2b3f09888a75ce
Propertiesproperty constraint (P2302)class (P2308)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX : <http://example.org/#>
CONSTRUCT {
?nodeShape
a sh:NodeShape ;
sh:targetClass ?domain ;
sh:property ?wdtShape .
?wdtShape
a sh:PropertyShape;
sh:path ?wdt ;
sh:class (?range) ;
sh:nodeKind sh:IRI
}
WHERE {
VALUES ?class {
wd:Q7366
}
BIND(URI(CONCAT(STR(?class), "#nodeShape")) AS ?nodeShape)
BIND(URI(CONCAT(STR(?wdt), "#wdtShape")) AS ?wdtShape)
?prop wikibase:directClaim ?wdt ;
p:P2302 [
ps:P2302 wd:Q21503250 ;
pq:P2308 ?domain
] ;
p:P2302 [
ps:P2302 wd:Q21510865 ;
pq:P2308 ?range
]
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v14("?_anon_42b5416610844a34809f33a099ae9de133789")
v12("?_const_2db401a8_uri")
v19("?_const_3401ac3a_uri")
v17("?_const_62c53cf1_uri")
v10("?_const_8b501c63_uri")
v13("?_const_b4ade5a9_uri")
v11("?_const_b5e2fd59_uri")
v9("?_const_c416139b_uri")
v15("?_const_c5f92d90_uri")
v18("?_const_e05c5874_uri")
v20("?_const_f54f5a3c_uri")
v16("?_const_f5e424f4_uri")
v8("?_const_f5e5585a_uri")
v1("?class"):::projected
v6("?domain"):::projected
v8("?nodeShape"):::projected
v4("?prop"):::projected
v7("?range"):::projected
v5("?wdt"):::projected
v12("?wdtShape"):::projected
a1((" ")):::projected
a2((" ")):::projected
c3(["wd:Q21503250"]):::iri
c6(["wd:Q21510865"]):::iri
bind0[/VALUES ?class/]
bind0-->v1
bind00(["wd:Q7366"])
bind00 --> bind0
bind1[/"concat(str(?class),'#nodeShape')"/]
v1 --o bind1
bind1 --as--o v8
bind2[/"concat(str(?wdt),'#wdtShape')"/]
v5 --o bind2
bind2 --as--o v12
v4 --"wikibase:directClaim"--> v5
a1 --"p:statement/P2302"--> c3
a1 --"p:qualifier/P2308"--> v6
v4 --"p:P2302"--> a1
a2 --"p:statement/P2302"--> c6
a2 --"p:qualifier/P2308"--> v7
v4 --"p:P2302"--> a2
bind3[/"?nodeShape"/]
v8 --o bind3
bind3 --as--o v8
bind4[/""a""/]
bind4 --as--o v8
bind5[/"http://www.w3.org/ns/shacl#NodeShape"/]
bind5 --as--o v9
bind6[/"http://www.w3.org/ns/shacl#targetClass"/]
bind6 --as--o v10
bind7[/"http://www.w3.org/ns/shacl#property"/]
bind7 --as--o v11
bind8[/"?wdtShape"/]
v12 --o bind8
bind8 --as--o v12
bind9[/"http://www.w3.org/ns/shacl#PropertyShape"/]
bind9 --as--o v12
bind10[/"http://www.w3.org/ns/shacl#path"/]
bind10 --as--o v13
bind11[/""/]
bind11 --as--o v14
bind12[/"http://www.w3.org/1999/02/22-rdf-syntax-ns#first"/]
bind12 --as--o v15
bind13[/"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"/]
bind13 --as--o v16
bind14[/"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/]
bind14 --as--o v17
bind15[/"http://www.w3.org/ns/shacl#class"/]
bind15 --as--o v18
bind16[/"http://www.w3.org/ns/shacl#nodeKind"/]
bind16 --as--o v19
bind17[/"http://www.w3.org/ns/shacl#IRI"/]
bind17 --as--o v20