query-4ef2114da02d20b8c24ea53052e188d8

rq turtle/ttl

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 . ?abstractCountry ps:P17 ?country .

OPTIONAL { ?abstractCountry pq:P580 ?from } OPTIONAL { ?abstractCountry pq:P582 ?to }

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 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 .
  ?abstractCountry ps:P17 ?country .

  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; v2("?abstractCountry") v3("?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:P17"--> v2 v2 --"p:statement/P17"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P580".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P582".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end