query-53933344c569ae19ef0c4bedd480b799

rq turtle/ttl

Banat und Belgrad

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
SELECT DISTINCT (GROUP_CONCAT(DISTINCT ?lang; SEPARATOR = ", ") AS ?sprachen) ?page_title ?article ?item (GROUP_CONCAT(DISTINCT ?io; SEPARATOR = ", ") AS ?ist_ein) (GROUP_CONCAT(DISTINCT ?einheit; SEPARATOR = ", ") AS ?verwaltung) ?bild ?comcat ?coordinate WHERE {
  {
    ?item (wdt:P131*) wd:Q720030.
    OPTIONAL {
      ?gepage schema:about ?item;
        schema:isPartOf <https://sr.wikipedia.org/>;
        schema:name ?ge_title.
    }
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q861539.
    OPTIONAL {
      ?gepage schema:about ?item;
        schema:isPartOf <https://ro.wikipedia.org/>;
        schema:name ?ge_title.
    }
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q867816.
    OPTIONAL {
      ?gepage schema:about ?item;
        schema:isPartOf <https://ro.wikipedia.org/>;
        schema:name ?ge_title.
    }
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q185586.
    OPTIONAL {
      ?gepage schema:about ?item;
        schema:isPartOf <https://ro.wikipedia.org/>;
        schema:name ?ge_title.
    }
  }
  UNION
  {
    ?item (wdt:P131*) wd:Q2074197.
    OPTIONAL {
      ?gepage schema:about ?item;
        schema:isPartOf <https://sr.wikipedia.org/>;
        schema:name ?ge_title.
    }
  }
  OPTIONAL {
    ?enwiki schema:about ?item;
      schema:isPartOf <https://en.wikipedia.org/>;
      schema:name ?en_title.
  }
  OPTIONAL {
    ?dewiki schema:about ?item;
      schema:isPartOf <https://de.wikipedia.org/>;
      schema:name ?de_title.
  }
  FILTER(((BOUND(?gepage))|| (BOUND(?dewiki))) || (BOUND(?enwiki)))
  OPTIONAL { ?item wikibase:sitelinks ?sl. }
  FILTER((BOUND(?sl)) && (?sl > 0 ))
  OPTIONAL {
    ?page schema:about ?item;
      schema:inLanguage ?lang.
  }
  FILTER(?lang IN("fr", "de", "en", "ro", "sr"))
  OPTIONAL { ?item wdt:P131 ?ve. }
  OPTIONAL { ?item wdt:P625 ?coordinate. }
  OPTIONAL { ?item wdt:P31 ?instance. }
  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 ?comcat)
  BIND(IF(BOUND(?dewiki), ?dewiki, IF(BOUND(?enwiki), ?enwiki, ?gepage)) AS ?article)
  BIND(IF(BOUND(?de_title), ?de_title, IF(BOUND(?en_title), ?en_title, ?ge_title)) AS ?page_title)
  FILTER(BOUND(?article))
  VALUES ?top {
    wd:Q1030034
    wd:Q41176
    wd:Q35145263
    wd:Q2065736
    wd:Q12076836
  }
  FILTER(EXISTS { ?item (wdt:P31/(wdt:P279*)) ?top. })
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,ro,sh,sr".
    ?item rdfs:label ?il.
    ?instance rdfs:label ?io.
    ?ve rdfs:label ?einheit.
  }
}
GROUP BY ?page_title ?article ?item ?bild ?comcat ?coordinate
ORDER BY (?page_title)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v20("?article"):::projected v17("?bild"):::projected v19("?comcat"):::projected v18("?commons") v15("?coordinate"):::projected v12("?de_title") v8("?dewiki") v22("?einheit"):::projected v11("?en_title") v9("?enwiki") v10("?ge_title") v7("?gepage") v20("?il") v16("?instance") v21("?io"):::projected v24("?ist_ein") v2("?item"):::projected v5("?lang"):::projected v13("?page") v20("?page_title"):::projected v6("?sl") v23("?sprachen") v20("?top") v14("?ve") v25("?verwaltung") a1((" ")) c10(["wd:Q720030"]):::iri c21([https://de.wikipedia.org/]):::iri c18(["wd:Q185586"]):::iri c20([https://en.wikipedia.org/]):::iri c28(["bd:serviceParam"]):::iri c17(["wd:Q867816"]):::iri c15(["wd:Q861539"]):::iri c30(["#91;AUTO_LANGUAGE#93;,en,ro,sh,sr"]):::literal c16([https://ro.wikipedia.org/]):::iri c19(["wd:Q2074197"]):::iri c13([https://sr.wikipedia.org/]):::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 --> v20 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v20 f1[["bound(?article)"]] f1 --> v20 list1c2(["de"]):::literal list1c3(["en"]):::literal list1c1(["fr"]):::literal list1c4(["ro"]):::literal list1c5(["sr"]):::literal list1c1 --o f2 list1c2 --o f2 list1c3 --o f2 list1c4 --o f2 list1c5 --o f2 f2[[" in "]] f2 --> v5 f3[["bound(?sl)?sl > '0^^xsd:integer'"]] f3 --> v6 f4[["((bound(?gepage) || bound(?dewiki)) || bound(?enwiki))"]] f4 --> v7 f4 --> v8 f4 --> v9 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; v2 --"wdt:P131"--> c19 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v2 v7 --"schema:isPartOf"--> c13 v7 --"schema:name"--> v10 end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c18 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v2 v7 --"schema:isPartOf"--> c16 v7 --"schema:name"--> v10 end end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c17 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v2 v7 --"schema:isPartOf"--> c16 v7 --"schema:name"--> v10 end end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c15 subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v2 v7 --"schema:isPartOf"--> c16 v7 --"schema:name"--> v10 end end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c10 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v2 v7 --"schema:isPartOf"--> c13 v7 --"schema:name"--> v10 end end union0r <== or ==> union0l end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v9 -."schema:about".-> v2 v9 --"schema:isPartOf"--> c20 v9 --"schema:name"--> v11 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v8 -."schema:about".-> v2 v8 --"schema:isPartOf"--> c21 v8 --"schema:name"--> v12 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v2 -."wikibase:sitelinks".-> v6 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v13 -."schema:about".-> v2 v13 --"schema:inLanguage"--> v5 end subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> v14 end subgraph optional10["(optional)"] style optional10 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P625".-> v15 end subgraph optional11["(optional)"] style optional11 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P31".-> v16 end subgraph optional12["(optional)"] style optional12 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v17 end subgraph optional13["(optional)"] style optional13 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P373".-> v18 end bind5[/"if(bound(?commons),concat('https://commons.wikimedia.org/wiki/Category:',str(?commons)),'')"/] v18 --o bind5 bind5 --as--o v19 bind6[/"if(bound(?dewiki),?dewiki,if(bound(?enwiki),?enwiki,?gepage))"/] v8 --o bind6 v9 --o bind6 v7 --o bind6 bind6 --as--o v20 bind7[/"if(bound(?de_title),?de_title,if(bound(?en_title),?en_title,?ge_title))"/] v12 --o bind7 v11 --o bind7 v10 --o bind7 bind7 --as--o v20 bind8[/VALUES ?top/] bind8-->v20 bind80(["wd:Q1030034"]) bind80 --> bind8 bind81(["wd:Q41176"]) bind81 --> bind8 bind82(["wd:Q35145263"]) bind82 --> bind8 bind83(["wd:Q2065736"]) bind83 --> bind8 bind84(["wd:Q12076836"]) bind84 --> bind8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c28 --"wikibase:language"--> c30 v2 --"rdfs:label"--> v20 v16 --"rdfs:label"--> v21 v14 --"rdfs:label"--> v22 end bind12[/"?lang"/] v5 --o bind12 bind12 --as--o v23 bind13[/"?io"/] v21 --o bind13 bind13 --as--o v24 bind14[/"?einheit"/] v22 --o bind14 bind14 --as--o v25