query-20cd915696bf04976ea3a6368817eba2

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?countryLabel ?item ?itemLabel (YEAR(?date) AS ?year) ?length_meters {
  ?item wdt:P31/wdt:P279* wd:Q2354973 . # to get all subclasses (types) of tunnels, change this to wd:Q44377 .
  ?item wdt:P17 ?country .
#  ?country wdt:P30 wd:Q46 .  # uncomment this line if you want to limit to countries in Europe
  OPTIONAL { ?item wdt:P1619 ?date }
  OPTIONAL { ?item p:P2043 [ psn:P2043  [ wikibase:quantityAmount ?length_meters ] ] . } # psn translates all values for length to a common unit, i.e. meters
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,nn,nb,da,fi,nl,cs,sk,lb,fr,el,es,ru". }
}
ORDER BY ?countryLabel STR(?itemLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?country") v1("?countryLabel"):::projected v5("?date"):::projected v3("?item"):::projected v2("?itemLabel"):::projected v6("?length_meters"):::projected v7("?year") a1((" ")) a3((" ")) a2((" ")) c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en,de,nn,nb,da,fi,nl,cs,sk,lb,fr,el,es,ru"]):::literal c3(["wd:Q2354973"]):::iri v3 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 v3 --"p:direct/P17"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P1619".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a2 -."wikibase:quantityAmount".-> v6 a3 --"p:statement/value-normalized/P2043"--> a2 v3 --"p:P2043"--> a3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind0[/"year-from-dateTime(?date)"/] v5 --o bind0 bind0 --as--o v7