query-f140898799b02462f63a178eb4f3537c

rq turtle/ttl

Male tennis players who were born before 1950 without an atp id

Draft

SELECT ?player ?date ?cause ?player_label ?atp_id WHERE { ?player wdt:P106 wd:Q10833314 . # find items that have "occupation (P106): tennis player (Q10833314)" ?player wdt:P569 ?date . # with a P569 (date of birth) claim ?player wdt:P21 wd:Q6581097 . # with a P21 (sex or gender) "sex or gender (P21): male (Q6581097)" ?player wdt:P536 ?atp_id .

FILTER (?date < "1950-01-01T00:00:00Z"^^xsd:dateTime) FILTER isBLANK(?atp_id) .

OPTIONAL {?player rdfs:label ?player_label filter (lang(?player_label) = "en") .} 
OPTIONAL {?cause rdfs:label ?cause_of_death_label filter (lang(?cause_of_death_label) = "en").}

} ORDER BY ASC (?player)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#Male tennis players who were born before 1950 without an atp id
#Draft

SELECT ?player ?date ?cause ?player_label ?atp_id
WHERE 
{
    ?player wdt:P106 wd:Q10833314 .    # find items that have "occupation (P106): tennis player (Q10833314)"
    ?player wdt:P569 ?date .       # with a P569 (date of birth) claim
    ?player wdt:P21 wd:Q6581097 .       # with a P21 (sex or gender) "sex or gender (P21): male (Q6581097)" 
    ?player wdt:P536 ?atp_id .


 FILTER (?date < "1950-01-01T00:00:00Z"^^xsd:dateTime)
 FILTER isBLANK(?atp_id) .

    OPTIONAL {?player rdfs:label ?player_label filter (lang(?player_label) = "en") .} 
    OPTIONAL {?cause rdfs:label ?cause_of_death_label filter (lang(?cause_of_death_label) = "en").}
}
ORDER BY ASC (?player)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?atp_id"):::projected v6("?cause"):::projected v2("?cause_of_death_label") v4("?date"):::projected v1("?player"):::projected v5("?player_label"):::projected c4(["wd:Q10833314"]):::iri c7(["wd:Q6581097"]):::iri f0[["isBlank(?atp_id)"]] f0 --> v3 f1[["?date < '1950-01-01T00:00:00Z^^xsd:dateTime'"]] f1 --> v4 v1 --"wdt:P106"--> c4 v1 --"wdt:P569"--> v4 v1 --"wdt:P21"--> c7 v1 --"wdt:P536"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."rdfs:label".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v2 end