query-984606262bcc0c065fdd937fcf33e666
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?numericQuantity ?coord ?layer WHERE { # put ?coord & ?layer in this select
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
}
{
SELECT DISTINCT ?item ?coord ?numericQuantity ?layer WHERE { # put ?coord ?layer in this select
OPTIONAL {?item wdt:P625 ?coord.} # get the coord
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q483110.
?item p:P1083 ?statement1.
?statement1 (psv:P1083/wikibase:quantityAmount) ?numericQuantity.
?statement1 a wikibase:BestRank.
FILTER(?numericQuantity > "59999"^^xsd:decimal)
MINUS {
?item p:P3999 ?statement_3.
?statement_3 psv:P3999 ?statementValue_3.
?statementValue_3 wikibase:timeValue ?P3999_3.
}
?item p:P625 ?statement4.
?statement4 (ps:P625) _:anyValueP625.
bind(if(?numericQuantity >100000,"100k+", # assign numeric ranges
if(?numericQuantity >90000,"90k+",
if(?numericQuantity >80000,"80k+",
if(?numericQuantity >70000,"70k+",
if(?numericQuantity >60000,"60k+",
if(?numericQuantity >50000,"50k+",
if(?numericQuantity >40000,"40k+",
if(?numericQuantity >30000,"30k+",
if(?numericQuantity >20000,"20k+",
if(?numericQuantity >10000,"10k+",
if(?numericQuantity >10000,"0k+",""))))))))))) as ?layer)
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?P3999_3")
v3("?coord"):::projected
v2("?item"):::projected
v10("?layer"):::projected
v1("?numericQuantity"):::projected
v4("?statement0")
v5("?statement1")
v9("?statement4")
v7("?statementValue_3")
v6("?statement_3")
a3((" "))
a1((" "))
a2((" "))
c15(["wikibase:BestRank"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;"]):::literal
c10(["wd:Q483110"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
f0[["?numericQuantity > '59999^^xsd:decimal'"]]
f0 --> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P625".-> v3
end
v2 --"p:P31"--> v4
v4 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c10
v2 --"p:P1083"--> v5
v5 --"p:statement/value/P1083"--> a2
a2 --"wikibase:quantityAmount"--> v1
v5 --"a"--> c15
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:P3999"--> v6
v6 --"p:statement/value/P3999"--> v7
v7 --"wikibase:timeValue"--> v8
end
v2 --"p:P625"--> v9
v9 --"p:statement/P625"--> a3
bind2[/"if(?numericQuantity > '100000^^xsd:integer','100k+',if(?numericQuantity > '90000^^xsd:integer','90k+',if(?numericQuantity > '80000^^xsd:integer','80k+',if(?numericQuantity > '70000^^xsd:integer','70k+',if(?numericQuantity > '60000^^xsd:integer','60k+',if(?numericQuantity > '50000^^xsd:integer','50k+',if(?numericQuantity > '40000^^xsd:integer','40k+',if(?numericQuantity > '30000^^xsd:integer','30k+',if(?numericQuantity > '20000^^xsd:integer','20k+',if(?numericQuantity > '10000^^xsd:integer','10k+',if(?numericQuantity > '10000^^xsd:integer','0k+','')))))))))))"/]
v1 --o bind2
bind2 --as--o v10