query-851b82c899d8a4b993c0fef4cc8c4bbf
multiple querrys in oneWhat is the correct way to make a query like the following using the or operator? SELECT ?Argentona ?ArgentonaLabel WHERE { ?Argentona wdt:P131 wd:Q11539; wdt:P19 wd:Q11539; wdt:P20 wd:Q11539; wdt:P551 wd:Q11539; SERVICE wikibase:label { bd:serviceParam wikibase:language "ca". } }
Use at
- https://query.wikidata.org/sparql
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 ?Argentona ?ArgentonaLabel WHERE {
{ ?Argentona wdt:P131 wd:Q11539 } union
{ ?Argentona wdt:P19 wd:Q11539 } union
{ ?Argentona wdt:P20 wd:Q11539 } union
{ ?Argentona wdt:P551 wd:Q11539 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "ca". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?Argentona"):::projected
c7(["bd:serviceParam"]):::iri
c2(["wd:Q11539"]):::iri
c9(["ca"]):::literal
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;
v1 --"wdt:P551"--> c2
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P20"--> c2
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P19"--> c2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P131"--> c2
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end