query-89cc63356677400d81ea1c30f26f44cb

rq turtle/ttl

Immaterial heritage SELECT ?item ?itemLabel ?itemDescription ?instanceLabel ?cityLabel ?placeLabel ?regionLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". } BIND(wd:Q640303 AS ?region) ?item wdt:P276 ?place.

{ ?item wdt:P31 wd:Q59544. } UNION { ?item wdt:P31 wd:Q77430579. } UNION { ?item wdt:P31 wd:Q11483816. }

{ ?place wdt:P706 ?region. } UNION { ?place wdt:P131 ?city. ?city wdt:P706 ?region. }

OPTIONAL { ?item wdt:P31 ?instance. } } ORDER BY (?itemLabel)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Immaterial heritage
SELECT ?item ?itemLabel ?itemDescription ?instanceLabel ?cityLabel ?placeLabel ?regionLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  BIND(wd:Q640303 AS ?region)
  ?item wdt:P276 ?place.

  { ?item wdt:P31 wd:Q59544. }
  UNION
  { ?item wdt:P31 wd:Q77430579. }
  UNION
  { ?item wdt:P31 wd:Q11483816. }

  { ?place wdt:P706 ?region. }
  UNION
  {
    ?place wdt:P131 ?city.
    ?city wdt:P706 ?region.
  }

  OPTIONAL { ?item wdt:P31 ?instance. }
}
ORDER BY (?itemLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?city") v6("?instance") v3("?item"):::projected v1("?itemLabel"):::projected v4("?place") v2("?region") c2(["bd:serviceParam"]):::iri c7(["wd:Q59544"]):::iri c4(["#91;AUTO_LANGUAGE#93;,nl,fr,de,en,es,it,no,se,fi"]):::literal c8(["wd:Q77430579"]):::iri c9(["wd:Q11483816"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end bind0[/"'wd:Q640303'"/] bind0 --as--o v2 v3 --"wdt:P276"--> v4 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; v3 --"wdt:P31"--> c9 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> c8 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> c7 end union0r <== or ==> union0l end subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P131"--> v5 v5 --"wdt:P706"--> v2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P706"--> v2 end union2r <== or ==> union2l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P31".-> v6 end