query-f87fe2a1e6e5e8ed9a8d7c9eae0b5cb3

rq turtle/ttl

مجمعة لكل بلدية على المحور س، متحركة حسب المسافة المرتبة (الأبعد ، ثاني أبعد، ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) seskupené podle obcí na ose x, animované podle vzdálenosti (nejvzdálenější, 2. nejvzdálenější, ...) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) gruppiert nach Gemeinde auf der x-Achse, animiert pro Distanzgruppe (weitest, zweit-weitest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) groupées par municipalité sur les abscisses, animé par ordre de distance décroissante (du plus éloigné au plus proche) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) raggruppati per comune sull'asse delle ascisse, animati per ordine di distanza (il più lontano, il secondo più lontano, ...) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) gegroepeerd per gemeente op x-as, geanimeerd door gerangschikte afstand (verste, op een na verste,..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grupperade kommuner i en x-axel, animerade efter rankad distans (längst, andra längst,...) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) згруповані за муніципалітетами по осі x, анімовані за ранжованою відстанню (найдальший, 2-й найдальший тощо) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..) grouped per municipality on x-axis, animated by ranked dist (farthest, 2nd farthest, ..)

Use at

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:ScatterChart
PREFIX var_muntype: <http://www.wikidata.org/entity/Q15284>
PREFIX var_area: <http://www.wikidata.org/entity/Q6308>
SELECT ?from ?kilometers ?to ?rank_group
WHERE {
  {
    SELECT (SAMPLE(?mun) AS ?mun) (SAMPLE(?mun2) AS ?mun2) (SAMPLE(?distNum) AS ?kilometers)
           (COUNT(*)-1 AS ?rg) (SUBSTR("00",1+STRLEN(STR(?rg))) AS ?rgpad)
           (IF(FLOOR((?rg-(100*FLOOR(?rg/100)))/10)=1,0,?rg-(10*FLOOR(?rg/10))) AS ?rgmod)
           (IF(?rgmod=1,"st",IF(?rgmod=2,"nd",IF(?rgmod=3,"rd","th"))) AS ?rgord)
           (CONCAT(?rgpad,STR(?rg),?rgord,"-most farthest places") AS ?rank_group)
    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
        }
      }
      OPTIONAL {
        { SELECT (?mun AS ?mun3) (SAMPLE(?loc) AS ?loc3)
          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).
      BIND(geof:distance(?loc, ?loc3) AS ?d).
      FILTER(?distNum >= ?d).
    } GROUP BY ?mun ?mun2 ?distNum
  }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en".
    ?mun rdfs:label ?from.
    ?mun2 rdfs:label ?to.
  }
}
ORDER BY ?rank_group ?kilometers ?from

Query found at