query-607df6aba95b0b202c024c72570029f8

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?birth ?genderLabel ?age WHERE {
  ?item wdt:P106 wd:Q10833314 ; wdt:P569 ?birth ; wdt:P21 ?gender .
  MINUS { ?item wdt:P570 [] }
#  BIND(YEAR(now())-YEAR(?birth) as ?age)
  BIND( YEAR(now()) - YEAR(?birth) - 
              IF(MONTH(now())<MONTH(?birth) || 
                 (MONTH(now())=MONTH(?birth) && DAY(now())<DAY(?birth)),1,0) AS ?age )
  FILTER ( ?age < 110 )
  ?tournament wdt:P1346 ?item . 
  ?tournament wdt:P2094 wd:Q16893403 . # men's single
  ?tournament wdt:P361 / wdt:P31 / wdt:P361 wd:Q102113 . # part of / instance of / part of Grand Slam
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?age)
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?age"):::projected v3("?birth"):::projected v4("?gender") v2("?item"):::projected v5("?tournament") a1((" ")) a2((" ")) a3((" ")) c12(["wd:Q102113"]):::iri c9(["wd:Q16893403"]):::iri c3(["wd:Q10833314"]):::iri c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?age < '110^^xsd:integer'"]] f0 --> v5 v2 --"wdt:P106"--> c3 v2 --"wdt:P569"--> v3 v2 --"wdt:P21"--> v4 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P570"--> a1 end bind2[/"year-from-dateTime(NOW()) - year-from-dateTime(?birth) - if((month-from-dateTime(NOW()) < month-from-dateTime(?birth) || month-from-dateTime(NOW()) = month-from-dateTime(?birth)day-from-dateTime(NOW()) < day-from-dateTime(?birth)),'1^^xsd:integer','0^^xsd:integer')"/] v3 --o bind2 bind2 --as--o v5 v5 --"wdt:P1346"--> v2 v5 --"wdt:P2094"--> c9 v5 --"wdt:P361"--> a2 a2 --"wdt:P31"--> a3 a3 --"wdt:P361"--> c12 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end