query-db44b2246af5e153d3eaf4c6c815a701
Sports seasons and unseasoned sport competitions items, since the typical class/instance model does not fit here. However, they should not replace class/instance relations for all sport competitions. (Q27020041)season ; this property should be used in (P3450)sports season of league or competition Watching: use of
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 ?league ?leagueLabel ?isLeague ?isCup ?isOrganization (COUNT(DISTINCT ?season) AS ?seasons) WHERE {
?season wdt:P3450 ?league .
BIND(EXISTS { ?league wdt:P31/wdt:P279* wd:Q623109 } AS ?isLeague) .
BIND(EXISTS { ?league wdt:P31/wdt:P279* wd:Q61629906 } AS ?isCup) .
BIND(EXISTS { ?league wdt:P31/wdt:P279* wd:Q43229 } AS ?isOrganization) .
FILTER(!(?isLeague|| ?isCup || ?isOrganization)) .
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
} GROUP BY ?league ?leagueLabel ?isLeague ?isCup ?isOrganization
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?isCup"):::projected
v6("?isLeague"):::projected
v6("?isOrganization"):::projected
v5("?league"):::projected
v4("?season"):::projected
v6("?seasons")
c3(["bd:serviceParam"]):::iri
c5(["en"]):::literal
f0[["not (?isLeague || (?isCup || ?isOrganization))"]]
f0 --> v6
f0 --> v6
f0 --> v6
v4 --"wdt:P3450"--> v5
v5 --"wdt:P31"--> null
null --"wdt:P279"--> null
bind1[/" "/]
subgraph bind1e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0c3
e0v1("?league"):::projected
e0a1((" ")):::projected
e0c3(["wd:Q623109"]):::iri
end
bind1--EXISTS--> bind1e0
v5 --o bind1
null --o bind1
null --o bind1
null --o bind1
null --o bind1
bind1 --as--o v6
v5 --"wdt:P31"--> null
null --"wdt:P279"--> null
bind2[/" "/]
subgraph bind2e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1a1
e1a1 --"wdt:P279"--> e1c3
e1v1("?league"):::projected
e1a1((" ")):::projected
e1c3(["wd:Q61629906"]):::iri
end
bind2--EXISTS--> bind2e1
v5 --o bind2
null --o bind2
null --o bind2
null --o bind2
null --o bind2
bind2 --as--o v6
v5 --"wdt:P31"--> null
null --"wdt:P279"--> null
bind3[/" "/]
subgraph bind3e2["Exists Clause"]
e2v1 --"wdt:P31"--> e2a1
e2a1 --"wdt:P279"--> e2c3
e2v1("?league"):::projected
e2a1((" ")):::projected
e2c3(["wd:Q43229"]):::iri
end
bind3--EXISTS--> bind3e2
v5 --o bind3
null --o bind3
null --o bind3
null --o bind3
null --o bind3
bind3 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c3 --"wikibase:language"--> c5
end
bind5[/"count(?season)"/]
v4 --o bind5
bind5 --as--o v6