query-136022d1cd265ebda707f54dc5d029d0

rq turtle/ttl

Union of two instances of (P31) How can I create a Query where I both have  ⟩object or value⟨  Search Q51077473  ⟩P31⟨  and  ⟩object or value⟨  Search Q18636219  ⟩P31⟨ I tried something like below but Ii may need a statement like UNION? SELECT ?Wikidata_egenskap_med_datatype__tidspunkt_ ?Wikidata_egenskap_med_datatype__tidspunkt_Label WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?Wikidata_egenskap_med_datatype__tidspunkt_ wdt:P31 wd:Q18636219. ?Wikidata_egenskap_med_datatype__tidspunkt_ wdt:P31 wd:Q51077473. } LIMIT 100 17:30, 11 June 2018 (UTC)) talk (PmtBest regards

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#>
SELECT DISTINCT ?item ?itemLabel
WHERE
{
  { ?item wdt:P31 wd:Q18636219 . }
  UNION
  { ?item wdt:P31 wd:Q51077473. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected c3(["wd:Q51077473"]):::iri c2(["wd:Q18636219"]):::iri c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c2 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end