query-9bb1c9d7bfbf852302e48d2676fe05d5
Canton du Québec
SELECT ?item ?itemLabel ?dtFondation ?km2 ?locationLabel ?coord
WHERE {
{ ?item wdt:P31/wdt:P279 wd:Q23019040 }
{ ?item wdt:P131/wdt:P279 wd:Q321529 }
OPTIONAL {?item wdt:P571 ?dtFondation} .
OPTIONAL {?item p:P2046 ?area_statement .
?area_statement psv:P2046 ?area_node .
?area_node wikibase:quantityAmount ?area .
?area_node wikibase:quantityUnit ?unit .
?unit wdt:P2370 ?conversionSI .
BIND(?area*?conversionSI/1000000 AS ?km2)} .
OPTIONAL {?item wdt:P131 ?location }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr" .
}
}
ORDER BY (?regionLabel)
LIMIT 500
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Canton du Québec
SELECT ?item ?itemLabel ?dtFondation ?km2 ?locationLabel ?coord
WHERE {
{ ?item wdt:P31/wdt:P279* wd:Q23019040 }
{ ?item wdt:P131/wdt:P279* wd:Q321529 }
OPTIONAL {?item wdt:P571 ?dtFondation} .
OPTIONAL {?item p:P2046 ?area_statement .
?area_statement psv:P2046 ?area_node .
?area_node wikibase:quantityAmount ?area .
?area_node wikibase:quantityUnit ?unit .
?unit wdt:P2370 ?conversionSI .
BIND(?area*?conversionSI/1000000 AS ?km2)} .
OPTIONAL {?item wdt:P131 ?location }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr" .
}
}
ORDER BY (?regionLabel)
LIMIT 500
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?area")
v5("?area_node")
v4("?area_statement")
v8("?conversionSI")
v3("?dtFondation"):::projected
v2("?item"):::projected
v9("?km2"):::projected
v10("?location")
v1("?regionLabel")
v7("?unit")
a1((" "))
a2((" "))
c5(["wd:Q321529"]):::iri
c3(["wd:Q23019040"]):::iri
c15(["fr"]):::literal
c13(["bd:serviceParam"]):::iri
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v2 --"p:direct/P131"--> a2
a2 --"p:direct/P279"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P571".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P2046".-> v4
v4 --"p:statement/value/P2046"--> v5
v5 --"wikibase:quantityAmount"--> v6
v5 --"wikibase:quantityUnit"--> v7
v7 --"p:direct/P2370"--> v8
bind0[/"?area * ?conversionSI / '1000000^^xsd:integer'"/]
v6 --o bind0
v8 --o bind0
bind0 --as--o v9
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P131".-> v10
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end