query-faf50fb8aedd25e916a73605bb0bc026

rq turtle/ttl

Male tennis players who were born before 1950 without an atp id SELECT ?player ?date ?cause ?player_label 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 (Q658109)"

FILTER not exists {?player wdt:P536 ?atp_id . } FILTER (?date < "1950-01-01T00:00:00Z"^^xsd:dateTime)

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) LIMIT 100

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
SELECT ?player ?date ?cause ?player_label
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 (Q658109)"

 FILTER not exists {?player wdt:P536 ?atp_id . }
 FILTER (?date < "1950-01-01T00:00:00Z"^^xsd:dateTime)


    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)
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?atp_id") v6("?cause"):::projected v2("?cause_of_death_label") v3("?date"):::projected v1("?player"):::projected v5("?player_label"):::projected c5(["wd:Q10833314"]):::iri c8(["wd:Q6581097"]):::iri f0[["?date < '1950-01-01T00:00:00Z^^xsd:dateTime'"]] f0 --> v3 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P536"--> e0v2 e0v2("?atp_id"):::projected e0v1("?player"):::projected end f1--EXISTS--> f1e0 f1 --> v1 f1 --> c3 f1 --> v4 v1 --"wdt:P536"--> v4 v1 --"wdt:P106"--> c5 v1 --"wdt:P569"--> v3 v1 --"wdt:P21"--> c8 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