Wikidata:WikiProject Cycling/SPARQL

Riders who have no english Wikipedia articleEdit

The following query uses these:

  • Properties: instance of (P31)    , occupation (P106)    
    1 SELECT DISTINCT ?item WHERE {
    2 ?item wdt:P31 wd:Q5. 
    3 ?item wdt:P106 wd:Q2309784  
    4 Minus {
    5 ?article schema:about ?item. 
    6 ?article schema:inLanguage "en". 
    7 FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/")
    8 }
    9 }
    

lists of all riders that have no english Wikipedia article

Cycling teams who have no english Wikipedia articleEdit

The following query uses these:

  • Properties: UCI code (P1998)    , part of (P361)    
     1 SELECT DISTINCT ?item WHERE {
     2 ?item wdt:P1998 ?obj1 
     3 Minus {
     4 ?item wdt:P361 ?obj2 
     5 }
     6 Minus {
     7 ?article schema:about ?item. 
     8 ?article schema:inLanguage "en". 
     9 FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/")
    10 }
    11 }
    

lists all cycling teams that have no english Wikipedia article

All racesEdit

The following query uses these:

  • Properties: sport (P641)    
    1 SELECT ?sport ?sportLabel WHERE {
    2 ?sport wdt:P641 wd:Q3609. 
    3 SERVICE wikibase:label {bd:serviceParam wikibase:language "fr", "en", "it"}   
    4 } ORDER BY ?sportLabel  LIMIT 1000
    

lists all races.

Races that have a distance (P2043) with the rank deprecatedEdit

The following query uses these:

  • Properties: sport (P641)    , length (P2043)    
    1 PREFIX p: <http://www.wikidata.org/prop/>
    2 PREFIX ps: <http://www.wikidata.org/prop/statement/>
    3 SELECT ?sportLabel ?sport ?vLabel ?v WHERE {
    4 ?sport wdt:P641 wd:Q3609.# all races
    5 ?wds wikibase:rank wikibase:DeprecatedRank.
    6 ?sport p:P2043 ?wds.
    7 ?wds ps:P2043 ?v.
    8 SERVICE wikibase:label {bd:serviceParam wikibase:language "en".}     
    9 }
    

list all races that have a distance (P2043) with the rank deprecated

Items that use qualifier P1642 (acquisition transaction)Edit

The following query uses these:

  • Properties: acquisition transaction (P1642)    
    1 SELECT ?name ?z1Label WHERE {
    2 # values for P1642 (acquisition transaction)   
    3 VALUES ?z1 {wd:Q4 wd:Q23498247 wd:Q23498248 wd:Q3428243 wd:Q23498196 wd:Q23531302 wd:Q23531338}
    4 ?name pq:P1642 ?z1
    5 SERVICE wikibase:label {bd:serviceParam wikibase:language "en", "fr"}   
    6 } ORDER BY ?z1Label
    

find all items that use qualifier P1642 (acquisition transaction)

Season-items, no team-itemsEdit

The following query uses these:

  • Properties: instance of (P31)    , part of (P361)    
    1 SELECT DISTINCT ?x ?xLabel ?teamLabel ?gLabel WHERE {
    2 VALUES ?team {wd:Q1785271 wd:Q20639847 wd:Q20653563 wd:Q20638319 wd:Q6154783 wd:Q382927 
    3                           wd:Q20653564 wd:Q1756006 wd:Q20653566 wd:Q20639848 wd:Q20652655} 
    4 ?x wdt:P31 ?team. 
    5 ?x wdt:P361 ?g. 
    6 SERVICE wikibase:label {bd:serviceParam wikibase:language "de,en,fr,nl"}      
    7 } ORDER BY DESC(?g)
    

Team-items, no season-itemsEdit

The following query uses these:

  • Properties: instance of (P31)    , part of (P361)    
    1 SELECT DISTINCT ?x ?xLabel WHERE {
    2 VALUES ?team {wd:Q1785271 wd:Q20639847 wd:Q20653563 wd:Q20638319 wd:Q6154783 wd:Q382927 
    3                           wd:Q20653564 wd:Q1756006 wd:Q20653566 wd:Q20639848 wd:Q20652655} 
    4 ?x wdt:P31 ?team. 
    5 FILTER NOT EXISTS {?x wdt:P361 ?g}
    6 SERVICE wikibase:label {bd:serviceParam wikibase:language "de,en,fr,es,nl,ca"}
    7 } ORDER BY DESC(?x)
    

Team-items, with de articleEdit

The following query uses these:

  • Properties: instance of (P31)    , part of (P361)    , dissolved, abolished or demolished (P576)    
     1 SELECT DISTINCT ?x ?xLabel WHERE {
     2 # find team-items, no season-items
     3 VALUES ?team {wd:Q1785271 wd:Q20639847 wd:Q20653563 wd:Q20638319 wd:Q6154783 wd:Q382927 wd:Q20653564 wd:Q1756006 wd:Q20653566 wd:Q20639848 wd:Q20652655} 
     4 ?x wdt:P31 ?team.
     5 ?article schema:about ?x .
     6 ?article schema:isPartOf <https://de.wikipedia.org/>.
     7 FILTER NOT EXISTS {?x wdt:P361 ?g}.
     8 FILTER NOT EXISTS {?x wdt:P576 ?gg}  
     9 SERVICE wikibase:label {bd:serviceParam wikibase:language "de,en,fr,es,nl,ca,pl,pt,it"}
    10 } ORDER BY ASC(?xLabel)
    

Items with sport (P641) onlyEdit