query-17d15f43bb4177a5fc82948f3d580361
TODO
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?label ?class ?sitelinks (GROUP_CONCAT(?tourL; separator=', ') AS ?tours) WHERE {
?item wdt:P279* wd:Q13219666; wdt:P279 [ rdfs:label ?class ]; wikibase:sitelinks ?sitelinks .
OPTIONAL { ?item rdfs:label ?label . FILTER(LANG(?label) = 'en') }
FILTER(LANG(?class) = 'en') .
?item wdt:P361 ?tour .
?tour rdfs:label ?tourL .
FILTER(LANG(?tourL) = 'en')
MINUS { ?tour wdt:P279* wd:Q7700500 } # rm tours here
MINUS { ?tour wdt:P31*/wdt:P279* wd:Q167170 } # rm tennis at multi-sport events
} GROUP BY ?item ?label ?class ?sitelinks
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?class"):::projected
v4("?item"):::projected
v3("?label"):::projected
v5("?sitelinks"):::projected
v6("?tour")
v1("?tourL"):::projected
v7("?tours")
a1((" "))
a2((" "))
c9(["wd:Q167170"]):::iri
c7(["wd:Q7700500"]):::iri
c3(["wd:Q13219666"]):::iri
f0[["?tourL = 'en'"]]
f0 --> v1
f1[["?class = 'en'"]]
f1 --> v2
v4 --"wdt:P279"--> c3
a1 --"rdfs:label"--> v2
v4 --"wdt:P279"--> a1
v4 --"wikibase:sitelinks"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v3
end
v4 --"wdt:P361"--> v6
v6 --"rdfs:label"--> v1
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v6 --"wdt:P279"--> c7
end
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v6 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c9
end
bind5[/"?tourL"/]
v1 --o bind5
bind5 --as--o v7