query-2b64029bcc64308faaa85001cdf5471b

rq turtle/ttl

Häufig benutzte AbfragenAlle Berge in bestimmtem Land oder Gebirge:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?mountain ?mountain_label ?coordinate ?elevation (GROUP_CONCAT(DISTINCT ?country_label; SEPARATOR=", ") AS ?countries) ?range_label (GROUP_CONCAT(DISTINCT ?entity_label; SEPARATOR=", ") AS ?entities)
WHERE 
{
  ?mountain wdt:P31 wd:Q8502.                    # ... ist ein Berg ...
# ?mountain wdt:P17 wd:Q863.                     # ... liegt in Land ... ODER
  ?mountain (wdt:P4552/wdt:P4552*) wd:Q161750.   # ... liegt in Gebirge.
  OPTIONAL { ?mountain wdt:P625 ?coordinate . }
  OPTIONAL { ?mountain wdt:P2044 ?elevation . }
  OPTIONAL { ?mountain wdt:P17 ?country . }
  OPTIONAL { ?mountain wdt:P4552 ?range . }
  OPTIONAL { ?mountain wdt:P131 ?entity . }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en".
                          ?mountain rdfs:label ?mountain_label.
                          ?country rdfs:label ?country_label.
                          ?range rdfs:label ?range_label.
                          ?entity rdfs:label ?entity_label.
                         }
}
GROUP BY ?mountain ?mountain_label ?coordinate ?elevation ?range ?range_label
ORDER BY DESC(?elevation)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coordinate"):::projected v11("?countries") v4("?country") v8("?country_label"):::projected v1("?elevation"):::projected v12("?entities") v6("?entity") v10("?entity_label"):::projected v2("?mountain"):::projected v7("?mountain_label"):::projected v5("?range") v9("?range_label"):::projected a1((" ")) c12(["en"]):::literal c4(["wd:Q161750"]):::iri c10(["bd:serviceParam"]):::iri c2(["wd:Q8502"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P4552"--> a1 a1 --"wdt:P4552"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2044".-> v1 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P17".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P4552".-> v5 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v2 --"rdfs:label"--> v7 v4 --"rdfs:label"--> v8 v5 --"rdfs:label"--> v9 v6 --"rdfs:label"--> v10 end bind2[/"?country_label"/] v8 --o bind2 bind2 --as--o v11 bind3[/"?entity_label"/] v10 --o bind3 bind3 --as--o v12