query-36e8d8c4dae38522b497a1ae3b4e9c40
list national parks with their inception, size, category. Other relevant properties can be added as optional. SELECT DISTINCT ?national_park ?national_parkLabel ?inception ?area ?category WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?national_park wdt:P31 wd:Q46169; wdt:P17 wd:Q854. OPTIONAL { ?national_park wdt:P571 ?inception } OPTIONAL { ?national_park wdt:P2046 ?area } OPTIONAL { ?national_park wdt:P373 ?category } }
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#>
# list national parks with their inception, size, category. Other relevant properties can be added as optional.
SELECT DISTINCT ?national_park ?national_parkLabel ?inception ?area ?category WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?national_park wdt:P31 wd:Q46169;
wdt:P17 wd:Q854.
OPTIONAL { ?national_park wdt:P571 ?inception }
OPTIONAL { ?national_park wdt:P2046 ?area }
OPTIONAL { ?national_park wdt:P373 ?category }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?area"):::projected
v4("?category"):::projected
v2("?inception"):::projected
v1("?national_park"):::projected
c2(["bd:serviceParam"]):::iri
c6(["wd:Q46169"]):::iri
c8(["wd:Q854"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P31"--> c6
v1 --"wdt:P17"--> c8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P571".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2046".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P373".-> v4
end