query-e9a431e196e9f6f567d5f5c43f55677c
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#>
SELECT ?item ?itemLabel ?type ?tournament ?tournamentLabel
WHERE
{
?item wdt:P31 wd:Q46190676 . # Instance of tennis event
?item wdt:P2094 wd:Q16893072 . # men's singles
MINUS
{
?item wdt:P1346 ?winner .
}
?item wdt:P361 ?tournament .
{
?tournament wdt:P361 ?tour .
?tour wdt:P3450 ?season_of .
VALUES ?season_of { wd:Q300008 } # ATP World Tour
BIND ("ATP world tour" AS ?type)
}
UNION
{
?tournament wdt:P31 ?a_grand_slam .
?a_grand_slam wdt:P361 wd:Q102113 . # part of grand slam
BIND ("Grand Slam" AS ?type)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?a_grand_slam")
v1("?item"):::projected
v6("?season_of")
v4("?tour")
v3("?tournament"):::projected
v8("?type"):::projected
v2("?winner")
c8(["wd:Q102113"]):::iri
c10(["bd:serviceParam"]):::iri
c2(["wd:Q46190676"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q16893072"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P2094"--> c4
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P1346"--> v2
end
v1 --"wdt:P361"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P31"--> v7
v7 --"wdt:P361"--> c8
bind1[/"'Grand Slam'"/]
bind1 --as--o v8
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P361"--> v4
v4 --"wdt:P3450"--> v6
bind2[/VALUES ?season_of/]
bind2-->v6
bind20(["wd:Q300008"])
bind20 --> bind2
bind3[/"'ATP world tour'"/]
bind3 --as--o v8
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end