query-610d771f56a70581fe3d9f7bc3b5261c

rq turtle/ttl

Cycle sport events: move claims from length (P2043) to event distance (P3157) and remove unreferenced bounds from values, if existingI request a bot run to do the following: However, plenty claims still have bounds as a leftover from the time when we were not able to use quantities without bounds. I therefore request to remove all “±0” bounds, if no reference is given in the P2043 statement. It might be worth to consider removing all “±[0.]1” bounds as well, but I am not fully sure about that (could be repaired manually otherwise as well). claims. Quantity amount values and units, as well as existing qualifiers and references should be kept.(P3157)event distance claims by (P2043)length , so basically sports competition items) replace all (Q13406554)sports competition (instances of subclasses of ?item wdt:P31/wdt:P279 wd:Q13406554In items which have This bot run will affect in total around 2634 claims:

Use at

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 ?diff {
  ?item p:P2043 [ psv:P2043 ?value ] . # items that use P2043 (length)
  ?value wikibase:quantityAmount ?length .
  OPTIONAL {
    ?value wikibase:quantityUpperBound ?upperBound; wikibase:quantityLowerBound ?lowerBound .
    BIND(?upperBound - ?lowerBound AS ?diff) .
  }
  ?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; v6("?diff"):::projected 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 bind0[/"?upperBound - ?lowerBound"/] v4 --o bind0 v5 --o bind0 bind0 --as--o v6 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