query-6520a2ddb3ee158725f52073e019e426
TODO
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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
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 ?date ?determination ?ref ?rank ?stat where
{
{
SELECT ?item (max(?date_) as ?date)
WHERE
{
?item wdt:P31 wd:Q747074.
?item p:P1082 ?stat.
?stat pq:P585 ?date_.
} group by ?item } ?item p:P1082 ?stat.
?stat pq:P585 ?date.
optional {?stat pq:P459 ?determination. }
optional {?stat prov:wasDerivedFrom/pr:P854 ?ref.}
filter not exists { ?stat a wikibase:BestRank. }
?stat wikibase:rank ?rank.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?date"):::projected
v3("?date_")
v5("?determination"):::projected
v2("?item"):::projected
v7("?rank"):::projected
v6("?ref"):::projected
v1("?stat"):::projected
a1((" "))
c2(["wikibase:BestRank"]):::iri
c12(["bd:serviceParam"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q747074"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"a"--> e0c2
e0v1("?stat"):::projected
e0c2(["wikibase:BestRank"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"a"--> c2
v2 --"p:direct/P31"--> c4
v2 --"p:P1082"--> v1
v1 --"p:qualifier/P585"--> v3
bind2[/"max(?date_)"/]
v3 --o bind2
bind2 --as--o v4
v2 --"p:P1082"--> v1
v1 --"p:qualifier/P585"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:qualifier/P459".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."prov:wasDerivedFrom".-> a1
a1 --"p:reference/P854"--> v6
end
v1 --"wikibase:rank"--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end