query-33c3b2c9083df937fd6789c7c2070a98
Multiple values and ranks qualifier but no value with preferred rank. (P582)end time I am still a bit lost in cases with multiple values. I need items that have at least one value with
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q4830453 .
?item p:P127 ?vlast .
?vlast pq:P582 [] .
?item p:P127 ?vlast2 .
FILTER NOT EXISTS {?vlast2 wikibase:rank wikibase:PreferredRank }.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?vlast")
v1("?vlast2")
a1((" "))
c8(["bd:serviceParam"]):::iri
c2(["wikibase:PreferredRank"]):::iri
c4(["wd:Q4830453"]):::iri
c10(["en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wikibase:rank"--> e0c2
e0v1("?vlast2"):::projected
e0c2(["wikibase:PreferredRank"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wikibase:rank"--> c2
v2 --"p:direct/P31"--> c4
v2 --"p:P127"--> v3
v3 --"p:qualifier/P582"--> a1
v2 --"p:P127"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end