query-f348d82d5b4831226d8a56d787b1fdaf
musée par dept SELECT ?item ?itemLabel ?communeLabel ?deptLabel ?image ?commons ?museoId WHERE { ?item (wdt:P31/(wdt:P279*)) wd:Q33506 . ?item wdt:P131 ?commune. ?commune wdt:P131 ?dept . ?dept wdt:P31 wd:Q6465 . ?commune wdt:P131 wd:Q12703 . OPTIONAL {?item wdt:P539 ?museoId. } OPTIONAL {?item wdt:P18 ?image. } OPTIONAL {?item wdt:P373 ?commons. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?communeLabel
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#musée par dept
SELECT ?item ?itemLabel ?communeLabel ?deptLabel ?image ?commons ?museoId WHERE {
?item (wdt:P31/(wdt:P279*)) wd:Q33506 .
?item wdt:P131 ?commune.
?commune wdt:P131 ?dept .
?dept wdt:P31 wd:Q6465 .
?commune wdt:P131 wd:Q12703 .
OPTIONAL {?item wdt:P539 ?museoId. }
OPTIONAL {?item wdt:P18 ?image. }
OPTIONAL {?item wdt:P373 ?commons. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?communeLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?commons"):::projected
v3("?commune")
v1("?communeLabel"):::projected
v4("?dept")
v6("?image"):::projected
v2("?item"):::projected
v5("?museoId"):::projected
a1((" "))
c3(["wd:Q33506"]):::iri
c11(["bd:serviceParam"]):::iri
c6(["wd:Q12703"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q6465"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P131"--> v3
v3 --"wdt:P131"--> v4
v4 --"wdt:P31"--> c5
v3 --"wdt:P131"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P539".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P373".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end