query-36212f1ef0714abcd0ea8c01669b362e

rq turtle/ttl

05:50, 30 July 2017 (UTC) Jura--- : Jura1@ 07:04, 30 July 2017 (UTC)) talk (Xaris333. I don't want the items that have no value for P3450 or just one value for P3450. (P3450)sports season of league or competition How can I find the items that have more than 1 value for

Use at

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 
    ?whatever ?whateverLabel 
    (COUNT(DISTINCT ?seasonof) as ?ct)
{
    ?item wdt:P31 wd:Q27020041 .
    ?item wdt:P31 ?whatever . 
    FILTER (?whatever != wd:Q27020041 )  
    ?item wdt:P3450 ?seasonof 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY
    ?item ?itemLabel 
    ?whatever ?whateverLabel 
HAVING (?ct > 1)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?ct") v3("?item"):::projected v4("?seasonof"):::projected v2("?whatever"):::projected c2(["wd:Q27020041"]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?ct > '1^^xsd:integer'"]] f0 --> v5 f1[["?whatever != 'wd:Q27020041'"]] f1 --> v2 v3 --"wdt:P31"--> c2 v3 --"wdt:P31"--> v2 v3 --"wdt:P3450"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind3[/"count(?seasonof)"/] v4 --o bind3 bind3 --as--o v5