query-df78d49f5633ad1b9c14df19c9551945

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 bd: <http://www.bigdata.com/rdf#>
SELECT ?transitsystemLabel ?stationLabel ?count ?stations WHERE {
{
  SELECT DISTINCT ?transitsystem ?transitsystemLabel ?stationLabel (COUNT(DISTINCT ?station) AS ?count) (GROUP_CONCAT(DISTINCT ?station) AS ?stations) WHERE {
    wd:Q5503 ^wdt:P279*/^wdt:P31 ?transitsystem .
    ?transitsystem ^wdt:P361 ?station .
    ?station wdt:P31/wdt:P279* wd:Q12819564 .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  } GROUP BY ?transitsystem ?transitsystemLabel ?stationLabel
}
  FILTER(?count > 1)
} ORDER BY DESC (?count) ASC (?transitsystemLabel) ASC (?stationLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count"):::projected v5("?station") v3("?stationLabel"):::projected v6("?stations"):::projected v4("?transitsystem") v2("?transitsystemLabel"):::projected a1((" ")) a2((" ")) c8(["bd:serviceParam"]):::iri c6(["wd:Q12819564"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q5503"]):::iri f0[["?count > '1^^xsd:integer'"]] f0 --> v6 a1 --"wdt:P279"--> c3 v4 --"wdt:P31"--> a1 v5 --"wdt:P361"--> v4 v5 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind3[/"count(?station)"/] v5 --o bind3 bind3 --as--o v6 bind4[/"?station"/] v5 --o bind4 bind4 --as--o v6