query-ada4dc8e28f6592da026340a3fff2bf7

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 psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?player ?playerLabel ?height_in_cm
WHERE
{
  ?player wdt:P31 wd:Q5 . # ?player is human
  ?player wdt:P21 wd:Q6581097 . # ?player is male
  ?player wdt:P106 wd:Q10833314 . # ?player is tennis player
  OPTIONAL {
    ?player p:P2048 / psn:P2048 / wikibase:quantityAmount ?normalized_height .
     BIND (?normalized_height * 100 AS ?height_in_cm)
  }

  wd:Q102113 wdt:P527 ?grand_slam . # ?grand_slam is a tennis grand slam tournament
  ?grand_slam_for_year wdt:P31 ?grand_slam . # ?grand_slam_for_year is a grand slam tourmament for a certain year
  ?event wdt:P361 ?grand_slam_for_year . # event is grand slam event
  ?event wdt:P2094 wd:Q16893072 . # event is a men's singles event
  ?event wdt:P1346 ?player . # ?player won ?event
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?player ?playerLabel ?height_in_cm
ORDER BY DESC(?height_in_cm)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?event") v4("?grand_slam") v5("?grand_slam_for_year") v4("?height_in_cm"):::projected v3("?normalized_height") v2("?player"):::projected a1((" ")) a2((" ")) c10(["wd:Q102113"]):::iri c4(["wd:Q6581097"]):::iri c6(["wd:Q10833314"]):::iri c17(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c19(["#91;AUTO_LANGUAGE#93;,en"]):::literal c14(["wd:Q16893072"]):::iri v2 --"p:direct/P31"--> c2 v2 --"p:direct/P21"--> c4 v2 --"p:direct/P106"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2048".-> a1 a1 --"p:statement/value-normalized/P2048"--> a2 a2 --"wikibase:quantityAmount"--> v3 bind0[/"?normalized_height * '100^^xsd:integer'"/] v3 --o bind0 bind0 --as--o v4 end c10 --"p:direct/P527"--> v4 v5 --"p:direct/P31"--> v4 v6 --"p:direct/P361"--> v5 v6 --"p:direct/P2094"--> c14 v6 --"p:direct/P1346"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 end