query-b4511794a5dc962c22eef5d9e3cabb8d

rq turtle/ttl

Glasgow, Aberdeen, Dundee

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Table
#title: Aberdeen, Dundee und Glasgow auf wikipedia
SELECT DISTINCT ?item ?page_title ?article (GROUP_CONCAT(DISTINCT ?instanz; SEPARATOR = ", ") AS ?ist_ein) (GROUP_CONCAT(DISTINCT ?standort; SEPARATOR = ", ") AS ?liegt_in) ?location WHERE {
  VALUES ?adminunit {
    wd:Q22
  }
  ?item wdt:P17 wd:Q145;
    (wdt:P131*) ?adminunit;
    wdt:P31 ?instance;
    wdt:P131 ?where.
  ?enwiki schema:about ?item;
    schema:isPartOf <https://en.wikipedia.org/>;
    schema:name ?en_title.
  ?item wdt:P625 ?location.
  OPTIONAL {
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?de_title.
  }
  OPTIONAL { ?item wdt:P856 ?website. }
  BIND(IF(BOUND(?dewiki), ?dewiki, ?enwiki) AS ?article)
  BIND(IF(BOUND(?de_title), ?de_title, ?en_title) AS ?page_title)
  FILTER((?where IN(wd:Q62274582, wd:Q2357511, wd:Q55934339)) && (!(?instance IN(wd:Q18019452, wd:Q46622, wd:Q89021600, wd:Q27971968))))
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?where rdfs:label ?standort.
    ?instance rdfs:label ?instanz.
  }
}
GROUP BY ?item ?page_title ?article ?location
ORDER BY (?liegt_in) (?ist_ein)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?adminunit") v13("?article"):::projected v11("?de_title") v10("?dewiki") v8("?en_title") v7("?enwiki") v4("?instance") v16("?instanz"):::projected v17("?ist_ein") v6("?item"):::projected v17("?liegt_in") v9("?location"):::projected v14("?page_title"):::projected v15("?standort"):::projected v12("?website") v3("?where") c17([https://de.wikipedia.org/]):::iri c14([https://en.wikipedia.org/]):::iri c20(["bd:serviceParam"]):::iri c22(["#91;AUTO_LANGUAGE#93;,en"]):::literal c9(["wd:Q145"]):::iri list0c1(["wd:Q62274582"]):::iri list0c3(["wd:Q55934339"]):::iri list0c2(["wd:Q2357511"]):::iri list0c1 --o f0 list0c2 --o f0 list0c3 --o f0 list1c3(["wd:Q89021600"]):::iri list1c1(["wd:Q18019452"]):::iri list1c4(["wd:Q27971968"]):::iri list1c2(["wd:Q46622"]):::iri list1c1 --o f0 list1c2 --o f0 list1c3 --o f0 list1c4 --o f0 f0[[" in not in "]] f0 --> v3 f0 --> v4 bind1[/VALUES ?adminunit/] bind1-->v5 bind10(["wd:Q22"]) bind10 --> bind1 v6 --"wdt:P17"--> c9 v6 --"wdt:P131"--> v5 v6 --"wdt:P31"--> v4 v6 --"wdt:P131"--> v3 v7 --"schema:about"--> v6 v7 --"schema:isPartOf"--> c14 v7 --"schema:name"--> v8 v6 --"wdt:P625"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v10 -."schema:about".-> v6 v10 --"schema:isPartOf"--> c17 v10 --"schema:name"--> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P856".-> v12 end bind2[/"if(bound(?dewiki),?dewiki,?enwiki)"/] v10 --o bind2 v7 --o bind2 bind2 --as--o v13 bind3[/"if(bound(?de_title),?de_title,?en_title)"/] v11 --o bind3 v8 --o bind3 bind3 --as--o v14 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c20 --"wikibase:language"--> c22 v3 --"rdfs:label"--> v15 v4 --"rdfs:label"--> v16 end bind6[/"?instanz"/] v16 --o bind6 bind6 --as--o v17 bind7[/"?standort"/] v15 --o bind7 bind7 --as--o v17