query-4ac56c95cbc287f6b5992af8c4221299
Wikidata:Bot requests
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?length ?upperBound ?lowerBound {
?item p:P2043 [ psv:P2043 ?value ] . # items that use P2043 (length)
?value wikibase:quantityAmount ?length .
OPTIONAL {
?value wikibase:quantityUpperBound ?upperBound; wikibase:quantityLowerBound ?lowerBound .
}
?item wdt:P31/wdt:P279* wd:Q13406554 . # and have P31 with subclass of sport competition (Q13406554)
# MINUS { # activate this to filter away items that are related to cycle sport
# VALUES ?cyclingClasses { wd:Q15091377 wd:Q18131152 }
# ?item wdt:P31/wdt:P279* ?cyclingClasses . # but not P31 with subclass of cycling race (Q15091377) or stage (Q18131152)
# }
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?length"):::projected
v5("?lowerBound"):::projected
v4("?upperBound"):::projected
v1("?value")
a1((" "))
a2((" "))
c10(["bd:serviceParam"]):::iri
c8(["wd:Q13406554"]):::iri
c12(["en"]):::literal
a1 --"p:statement/value/P2043"--> v1
v2 --"p:P2043"--> a1
v1 --"wikibase:quantityAmount"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wikibase:quantityUpperBound".-> v4
v1 --"wikibase:quantityLowerBound"--> v5
end
v2 --"p:direct/P31"--> a2
a2 --"p:direct/P279"--> c8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end