query-1ce455714dc4ff593c3e44c0734e8e72

rq turtle/ttl

slowenische Namen in Kärnten

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":"?rgb"}
#title: find item in Kärnten with de / sl labels
SELECT ?item ?itemLabel ?itemDescription ?labelDe ?labelSl ?coord ?rgb ?layer WHERE {
   {
  SELECT DISTINCT ?item ?labelDe ?labelSl WHERE {
    ?item wdt:P17 wd:Q40 .
    ?item wdt:P625 [] .
    ?item wdt:P131*/wdt:P279* wd:Q37985 .
    OPTIONAL {
      ?item rdfs:label ?labelDe .
      FILTER(LANG(?labelDe) = 'de') .
    }
    OPTIONAL {
      ?item rdfs:label ?labelSl .
      FILTER(LANG(?labelSl) = 'sl') .
    }

  }
}.
  ?item wdt:P31 [] .
  ?item p:P625 ?coordStatement .
  ?coordStatement ps:P625 ?coord .

  bind (if (bound(?labelDe), if (bound(?labelSl), if (?labelDe = ?labelSl, 'ffff00', '00ff00'), 'ff0000'), '000000') as ?rgb ).
  bind (if (bound(?labelDe), if (bound(?labelSl), if (?labelDe = ?labelSl, 'de=sl?', 'de!=sl'), 'no sl'), 'no de') as ?layer ).
  SERVICE wikibase:label { bd:serviceParam wikibase:language '[AUTO_LANGUAGE,de,en]' }
} GROUP BY ?item ?itemLabel ?itemDescription ?labelDe ?labelSl ?coord ?rgb ?layer ORDER BY ASC(?item)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?coord"):::projected v4("?coordStatement") v1("?item"):::projected v3("?labelDe"):::projected v2("?labelSl"):::projected v7("?layer"):::projected v6("?rgb"):::projected a1((" ")) a3((" ")) a2((" ")) c4(["wd:Q40"]):::iri c8(["wd:Q37985"]):::iri c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE,de,en#93;"]):::literal v1 --"p:direct/P17"--> c4 v1 --"p:direct/P625"--> a1 v1 --"p:direct/P131"--> a2 a2 --"p:direct/P279"--> c8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."rdfs:label".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."rdfs:label".-> v2 end v1 --"p:direct/P31"--> a3 v1 --"p:P625"--> v4 v4 --"p:statement/P625"--> v5 bind0[/"if(bound(?labelDe),if(bound(?labelSl),if(?labelDe = ?labelSl,'ffff00','00ff00'),'ff0000'),'000000')"/] v3 --o bind0 v2 --o bind0 bind0 --as--o v6 bind1[/"if(bound(?labelDe),if(bound(?labelSl),if(?labelDe = ?labelSl,'de=sl?','de!=sl'),'no sl'),'no de')"/] v3 --o bind1 v2 --o bind1 bind1 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end