query-b00c536f318386dd427806ff6c811137

rq turtle/ttl

So I tried UNION to expand the query. For testing I included the museums of another country. It works.

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?item WHERE {
  {
    ?item wdt:P31/wdt:P279* wd:Q33506;
      wdt:P17 wd:Q40.
  }
  UNION
  {
    ?item wdt:P31/wdt:P279* wd:Q33506;
      wdt:P17 wd:Q191.
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected a1((" ")) a2((" ")) c3(["wd:Q33506"]):::iri c6(["wd:Q191"]):::iri c5(["wd:Q40"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c3 v1 --"wdt:P17"--> c6 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v1 --"wdt:P17"--> c5 end union0r <== or ==> union0l end