query-ed5b38764dc8bfe3a316899d08a672ac
مجمعة حسب نطاق المسافة، مرمزة بالألوان grouped by dist range, color-coded grouped by dist range, color-coded seskupené podle vzdálenosti, barevně označené grouped by dist range, color-coded gruppiert in Abstandsbereiche, farbkodiert grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded groupées par niveau de distance, la couleur dépendant de la distance grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded raggruppati per distanza, codificati per colore grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded gegroepeerd op afstand, kleurgecodeerd grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grouped by dist range, color-coded grupperade efter distans, färgade grouped by dist range, color-coded grouped by dist range, color-coded згруповані за діапазонами відстаней, позначені кольором grouped by dist range, color-coded grouped by dist range, color-coded
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BarChart
PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
SELECT ?from ?to ?distGrp WHERE {
{
SELECT ?from ?to ?distNum ?mun ?mun2 WHERE {
{ SELECT ?mun (SAMPLE(?loc) AS ?loc)
WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
wdt:P131 var_area:;
wdt:P625 ?loc. }
GROUP BY ?mun
}
OPTIONAL {
{ SELECT (?mun AS ?mun2) (SAMPLE(?loc) AS ?loc2)
WHERE { ?mun wdt:P31/wdt:P279* var_muntype:;
wdt:P131 var_area:;
wdt:P625 ?loc. }
GROUP BY ?mun
}
}
BIND(geof:distance(?loc, ?loc2) AS ?distNum).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en".
?mun rdfs:label ?from.
?mun2 rdfs:label ?to.
}
}
}
FILTER(CONCAT(?from,STR(?mun)) <= CONCAT(?to,STR(?mun2))).
#BIND(IF(STR(?from) < STR(?to),CONCAT(?from," <--> ",?to),
# CONCAT(?to," <--> ",?from)) AS ?distLabel).
BIND(COALESCE(
IF(?distNum >= 40, "40 - .. km", 1/0),
IF(?distNum >= 30, "30 - 40 km", 1/0),
IF(?distNum >= 20, "20 - 30 km", 1/0),
IF(?distNum >= 10, "10 - 20 km", 1/0),
IF(?distNum >= 5, "05 - 10 km", 1/0),
IF(?distNum >= 1, "01 - 05 km", "00 - 01 km")) AS ?distGrp).
}
ORDER BY ?from ?distGrp
Query found at
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ar
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/be-tarask
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ca
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/cs
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/da
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/de
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en-gb
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/eo
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/es
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/eu
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/fr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/he
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/hy
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/id
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/it
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ja
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ko
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/lb
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/lt
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ms
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/nl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/pl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/pt-br
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ro
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/ru
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/si
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/sv
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/th
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/tr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/uk
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/vec
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/zh