Open main menu

User talk:GodeNehler

new

U-Bahn-KarteEdit

Basierend auf dieser Diskussion letztes Jahr eine Karte für die U-Bahn Berlin:

#defaultView:Map{"hide":["?coordinates", "?line", "?rgb"]}
SELECT DISTINCT ?coordinates ?line ?item ?itemLabel ?connectLabel ?image ?opening ?rgb

WITH {
  SELECT ?item (SAMPLE(?coordinates) AS ?coordinates) (SAMPLE(?image) AS ?image) (sample(?lat1) as ?lat1) (sample(?lon1) as ?lon1) (sample(?opening) as ?opening) WHERE {
    ?item wdt:P361 wd:Q68646 .
    ?item wdt:P625 ?coordinates  .
    ?item p:P625 / psv:P625 / wikibase:geoLatitude ?lat1 .
    ?item p:P625 / psv:P625 / wikibase:geoLongitude ?lon1 .
    OPTIONAL { ?item wdt:P18 ?image }.
    OPTIONAL { ?item wdt:P1619 ?opening }.
  } GROUP BY ?item
} AS %stations

WITH {
  SELECT ?nextstation (sample(?lat2) as ?lat2) (sample(?lon2) as ?lon2) WHERE {
    ?nextstation wdt:P361 wd:Q68646 .
    ?nextstation p:P625 / psv:P625 / wikibase:geoLatitude ?lat2 .
    ?nextstation p:P625 / psv:P625 / wikibase:geoLongitude ?lon2 .
  } GROUP BY ?nextstation
} AS %nextstations

WITH {
  SELECT ?line ?connect ?rgb WHERE {
    INCLUDE %stations .
    INCLUDE %nextstations .
    ?item p:P197 ?nextstationstatement .
    ?nextstationstatement ps:P197 ?nextstation .
    ?nextstationstatement pq:P81 ?connect . ?connect wdt:P361 wd:Q68646  . 
    ?connect wdt:P465 ?rgb .
    FILTER(STR(?item) < STR(?nextstation)) .    
    BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ')') AS ?str) .
    BIND(STRDT(?str, geo:wktLiteral) AS ?line) 
  }
} AS %lines 
 
WHERE {
  { INCLUDE %stations }  UNION { INCLUDE %lines  } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!

Bei vielen Stationen fehlt offenbar noch die Aussage adjacent station (P197). (Ich habe aber auch keine Ahnung, wie weit die Datenobjekte überhaupt schon sauber zwischen U-Bahn-Station, S-Bahn-Station, evtl. Bahnhofsgebäude getrennt sind.) --TweetsFactsAndQueries (talk) 16:24, 14 April 2019 (UTC)

Merging itemsEdit

Hallo GodeNehler,
When you (want to) merge items, you may want to use the merge.js gadget from help page about merging. It helps with merging and removes the need to file a request on Wikidata:Requests for deletions.
With regards,- сyсn - (talkcontribslogs) 06:17, 15 April 2019 (UTC)

Return to the user page of "GodeNehler".