query-e67a3347b4fdc32d81cf03ece341d73d
Execution methods by country with time of usage SELECT DISTINCT ?itemLabel ?countryLabel ?from ?to WHERE { ?item wdt:P31 wd:Q15169167 . ?item wdt:P17 ?country . ?item p:P17 ?abstractCountry .
OPTIONAL { ?abstractCountry pq:P580 ?from } OPTIONAL { ?abstractCountry pq:P582 ?to }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Execution methods by country with time of usage
SELECT DISTINCT ?itemLabel ?countryLabel ?from ?to WHERE {
?item wdt:P31 wd:Q15169167 .
?item wdt:P17 ?country .
?item p:P17 ?abstractCountry .
OPTIONAL { ?abstractCountry pq:P580 ?from }
OPTIONAL { ?abstractCountry pq:P582 ?to }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?abstractCountry")
v2("?country")
v4("?from"):::projected
v1("?item")
v5("?to"):::projected
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q15169167"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:direct/P17"--> v2
v1 --"p:P17"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P580".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P582".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end