query-754297547919c9eeef279f83e6a155a5

rq turtle/ttl

Oberbayern

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 OA/LL/WM/GAP/TÖL/MB/RO/TS/BGL
SELECT DISTINCT ?page_title (GROUP_CONCAT(DISTINCT ?instanceLabel; SEPARATOR = ", ") AS ?ist_ein) (GROUP_CONCAT(DISTINCT ?velabel; SEPARATOR = ", ") AS ?verwaltungseinheiten) ?article ?item ?bild ?comkat ?location WHERE {
  {
    ?item (wdt:P131*) wd:Q10507;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10518;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10516;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10405;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10526;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q4007;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10522;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10523;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q487971;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10528;
      wdt:P131 ?ve.
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?detitle.
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q10530;
      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:P18 ?bild. }
  OPTIONAL { ?item wdt:P373 ?commons. }
  BIND(IF(BOUND(?commons), URI(CONCAT("https://commons.wikimedia.org/wiki/Category:", STR(?commons))), "") AS ?comkat)
  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 ?bild ?comkat ?location
ORDER BY (?verwaltungseinheiten)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v16("?article"):::projected v9("?bild"):::projected v11("?comkat"):::projected v10("?commons") v13("?datitle") v12("?dawiki") v6("?detitle") v5("?dewiki") v7("?instance") v18("?instanceLabel"):::projected v20("?ist_ein") v15("?istitle") v14("?iswiki") v2("?item"):::projected v8("?location"):::projected v17("?page_title"):::projected v18("?top") v4("?ve") v19("?velabel"):::projected v21("?verwaltungseinheiten") a1((" ")) c7([https://de.wikipedia.org/]):::iri c4(["wd:Q10507"]):::iri c17(["wd:Q10528"]):::iri c25(["bd:serviceParam"]):::iri c16(["wd:Q487971"]):::iri c18(["wd:Q10530"]):::iri c27(["#91;AUTO_LANGUAGE#93;,is,da,en"]):::literal c9(["wd:Q10518"]):::iri c10(["wd:Q10516"]):::iri c11(["wd:Q10405"]):::iri c12(["wd:Q10526"]):::iri c15(["wd:Q10523"]):::iri c13(["wd:Q4007"]):::iri c22([https://da.wikipedia.org/]):::iri c23([https://is.wikipedia.org/]):::iri c14(["wd:Q10522"]):::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 --> v18 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v18 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; v2 --"wdt:P131"--> c18 v2 --"wdt:P131"--> v4 v5 --"schema:about"--> v2 v5 --"schema:isPartOf"--> c7 v5 --"schema:name"--> v6 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:P18".-> v9 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P373".-> v10 end bind1[/"if(bound(?commons),concat('https://commons.wikimedia.org/wiki/Category:',str(?commons)),'')"/] v10 --o bind1 bind1 --as--o v11 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v12 -."schema:about".-> v2 v12 --"schema:isPartOf"--> c22 v12 --"schema:name"--> v13 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v14 -."schema:about".-> v2 v14 --"schema:isPartOf"--> c23 v14 --"schema:name"--> v15 end bind2[/"if(bound(?iswiki),?iswiki,if(bound(?dawiki),?dawiki,?dewiki))"/] v14 --o bind2 v12 --o bind2 v5 --o bind2 bind2 --as--o v16 bind3[/"?detitle"/] v6 --o bind3 bind3 --as--o v17 bind4[/VALUES ?top/] bind4-->v18 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; c25 --"wikibase:language"--> c27 v7 --"rdfs:label"--> v18 v4 --"rdfs:label"--> v19 end bind7[/"?instanceLabel"/] v18 --o bind7 bind7 --as--o v20 bind8[/"?velabel"/] v19 --o bind8 bind8 --as--o v21