query-2b52dfb688658e1b4527975327eaeb35
Like this? I’m not sure if the connection from winner statement to tournament is correct – I tried to imply it from some example items, but in most cases there didn’t seem to be any connection from the event to the tournament. clause). SELECT (I added it at the end of the ?handednessLabel AS ?layer if it exists, so you just need to include ?layer: Sure! The map dot color is determined by the variable Wolbo @┘────────────────────────────────────────────────────────────────────────────────────────────────────┌
Use at
- https://query.wikidata.org/sparql
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#>
#defaultView:Map
SELECT DISTINCT ?tournament ?tournamentLabel ?tournamentEdition ?tournamentEditionLabel ?player ?playerLabel ?handednessLabel (YEAR(?dateOfBirth) AS ?yearOfBirth) ?placeOfBirthLabel ?placeOfBirthCoordinates ?countryLabel ?dateOfBirth (?handednessLabel AS ?layer) WHERE {
?player wdt:P31 wd:Q5;
wdt:P21 wd:Q6581072;
wdt:P106 wd:Q10833314.
?event wdt:P1346 ?player.
?event wdt:P31 wd:Q16893403;
wdt:P361 ?tournamentEdition.
?tournamentEdition wdt:P31 ?tournament.
?tournament wdt:P361 wd:Q102113.
OPTIONAL { ?player wdt:P552 ?handedness. }
OPTIONAL { ?player wdt:P569 ?dateOfBirth. }
OPTIONAL {
?player wdt:P19 ?placeOfBirth.
OPTIONAL { ?placeOfBirth wdt:P625 ?placeOfBirthCoordinates. }
}
OPTIONAL { ?player wdt:P27 ?country. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?tournamentLabel ?tournamentEditionLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?country")
v8("?dateOfBirth"):::projected
v4("?event")
v7("?handedness")
v13("?layer")
v9("?placeOfBirth")
v10("?placeOfBirthCoordinates"):::projected
v3("?player"):::projected
v6("?tournament"):::projected
v5("?tournamentEdition"):::projected
v2("?tournamentEditionLabel"):::projected
v1("?tournamentLabel"):::projected
v12("?yearOfBirth")
c10(["wd:Q102113"]):::iri
c8(["wd:Q16893403"]):::iri
c19(["en"]):::literal
c4(["wd:Q6581072"]):::iri
c6(["wd:Q10833314"]):::iri
c17(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
v3 --"wdt:P31"--> c2
v3 --"wdt:P21"--> c4
v3 --"wdt:P106"--> c6
v4 --"wdt:P1346"--> v3
v4 --"wdt:P31"--> c8
v4 --"wdt:P361"--> v5
v5 --"wdt:P31"--> v6
v6 --"wdt:P361"--> c10
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P552".-> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P569".-> v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P19".-> v9
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P625".-> v10
end
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P27".-> v11
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c17 --"wikibase:language"--> c19
end
bind0[/"year-from-dateTime(?dateOfBirth)"/]
v8 --o bind0
bind0 --as--o v12
bind1[/"?handednessLabel"/]
null --o bind1
bind1 --as--o v13