query-ae831d0ee398963f5d28fdf4aa654580

rq turtle/ttl

Region München

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:Map
#title: Wikipediaseiten mit Bezug zu A/AIC/FFB/STA/M/EBE/ED/FS/DAH/PAF/LA
SELECT DISTINCT ?page_title (GROUP_CONCAT(DISTINCT ?instanceLabel; SEPARATOR = ", ") AS ?ist_ein) (GROUP_CONCAT(DISTINCT ?velabel; SEPARATOR = ", ") AS ?verwaltungseinheiten) ?article ?item ?comcat ?location WHERE {
  {
    ?item (wdt:P131*) wd:Q2749;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10414;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10415;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10502;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10504;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10544;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10541;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10539;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10497;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10500;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10496;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q3974;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10475;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  } 
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL { ?item wdt:P625 ?location. }
  OPTIONAL { ?item wdt:P373 ?commons. }
  BIND(IF(BOUND(?commons), URI(CONCAT("https://commons.wikimedia.org/wiki/Category:", STR(?commons))), "") AS ?comcat)
  OPTIONAL {
    ?dawiki schema:about ?item;
      schema:isPartOf <https://da.wikipedia.org/>;
      schema:name ?datitle.
  }
  OPTIONAL {
    ?iswiki schema:about ?item;
      schema:isPartOf <https://is.wikipedia.org/>;
      schema:name ?istitle.
  }
  BIND(IF(BOUND(?iswiki), ?iswiki, IF(BOUND(?dawiki), ?dawiki, ?dewiki)) AS ?article)
  BIND(?detitle AS ?page_title)
  VALUES ?top {
    wd:Q1030034
    wd:Q41176
    wd:Q35145263
    wd:Q2065736
  }
  FILTER(EXISTS { ?item (wdt:P31/(wdt:P279*)) ?top. })
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],is,da,en".
    ?instance rdfs:label ?instanceLabel.
    ?ve rdfs:label ?velabel.
  }
}
GROUP BY ?item ?page_title ?article ?comcat ?location
ORDER BY (?verwaltungseinheiten)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v15("?article"):::projected v10("?comcat"):::projected v9("?commons") v12("?datitle") v11("?dawiki") v6("?detitle") v5("?dewiki") v7("?instance") v17("?instanceLabel"):::projected v19("?ist_ein") v14("?istitle") v13("?iswiki") v2("?item"):::projected v8("?location"):::projected v16("?page_title"):::projected v17("?top") v4("?ve") v18("?velabel"):::projected v20("?verwaltungseinheiten") a1((" ")) c7([https://de.wikipedia.org/]):::iri c4(["wd:Q2749"]):::iri c18(["wd:Q10496"]):::iri c26(["bd:serviceParam"]):::iri c10(["wd:Q10415"]):::iri c9(["wd:Q10414"]):::iri c16(["wd:Q10497"]):::iri c20(["wd:Q10475"]):::iri c28(["#91;AUTO_LANGUAGE#93;,is,da,en"]):::literal c15(["wd:Q10539"]):::iri c12(["wd:Q10504"]):::iri c11(["wd:Q10502"]):::iri c19(["wd:Q3974"]):::iri c23([https://da.wikipedia.org/]):::iri c24([https://is.wikipedia.org/]):::iri c13(["wd:Q10544"]):::iri c17(["wd:Q10500"]):::iri c14(["wd:Q10541"]):::iri f0[[" "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0a1 e0a1 --"wdt:P279"--> e0v2 e0v1("?item"):::projected e0v2("?top"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> a1 f0 --> c2 f0 --> v17 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v17 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; subgraph union7[" Union "] subgraph union7l[" "] style union7l fill:#abf,stroke-dasharray: 3 3; subgraph union8[" Union "] subgraph union8l[" "] style union8l fill:#abf,stroke-dasharray: 3 3; subgraph union9[" Union "] subgraph union9l[" "] style union9l fill:#abf,stroke-dasharray: 3 3; subgraph union10[" Union "] subgraph union10l[" "] style union10l fill:#abf,stroke-dasharray: 3 3; subgraph union11[" Union "] subgraph union11l[" "] style union11l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c20 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end subgraph union11r[" "] style union11r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c19 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union11r <== or ==> union11l end end subgraph union10r[" "] style union10r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c18 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union10r <== or ==> union10l end end subgraph union9r[" "] style union9r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c17 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union9r <== or ==> union9l end end subgraph union8r[" "] style union8r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c16 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union8r <== or ==> union8l end end subgraph union7r[" "] style union7r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c15 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union7r <== or ==> union7l end end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c14 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union6r <== or ==> union6l end end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c13 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c12 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c11 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c10 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c9 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c4 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P31".-> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P373".-> v9 end bind1[/"if(bound(?commons),concat('https://commons.wikimedia.org/wiki/Category:',str(?commons)),'')"/] v9 --o bind1 bind1 --as--o v10 subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v11 -."schema:about".-> v2 v11 --"schema:isPartOf"--> c23 v11 --"schema:name"--> v12 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v13 -."schema:about".-> v2 v13 --"schema:isPartOf"--> c24 v13 --"schema:name"--> v14 end bind2[/"if(bound(?iswiki),?iswiki,if(bound(?dawiki),?dawiki,?dewiki))"/] v13 --o bind2 v11 --o bind2 v5 --o bind2 bind2 --as--o v15 bind3[/"?detitle"/] v6 --o bind3 bind3 --as--o v16 bind4[/VALUES ?top/] bind4-->v17 bind40(["wd:Q1030034"]) bind40 --> bind4 bind41(["wd:Q41176"]) bind41 --> bind4 bind42(["wd:Q35145263"]) bind42 --> bind4 bind43(["wd:Q2065736"]) bind43 --> bind4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c26 --"wikibase:language"--> c28 v7 --"rdfs:label"--> v17 v4 --"rdfs:label"--> v18 end bind7[/"?instanceLabel"/] v17 --o bind7 bind7 --as--o v19 bind8[/"?velabel"/] v18 --o bind8 bind8 --as--o v20