query-e13e91188e862af15a2ce1453a4fb6cc

rq turtle/ttl

All sports leagues must have: (only) (Q27020041)season --> (P31)instance of and (only one value) (P641)sport (only one value) (P3450)sports season of league or competition Useful checks: --> something else if is not a season). (P31)instance of (or (Q27020041)season --> (P31)instance of --> something else. They must only have (P31)instance of and (Q27020041)season --> (P31)instance of 1) Items that have Property with more than one values, the first value is specific 01:54, 30 July 2017 (UTC)) talk (Xaris333Hello. I want a query that show all the items that have P31 --> Q27020041 but also have another value(s) with P31. I don't want to have the items that have only P31 --> Q27020041. All the items of the list must have P31 --> Q27020041 plus P31 --> anything else. : Xaris333@

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 DISTINCT 
    ?item ?itemLabel 
    ?whatever ?whateverLabel 
    # ?seasonof ?seasonofLabel
{
    ?item wdt:P31 wd:Q27020041 .
    ?item wdt:P31 ?whatever . 
    FILTER (?whatever != wd:Q27020041 )  
    # OPTIONAL {  ?item wdt:P3450 ?seasonof }
    # FILTER ( ?whatever = ?seasonof )
    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; v2("?item"):::projected v1("?whatever"):::projected c1(["wd:Q27020041"]):::iri c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?whatever != 'wd:Q27020041'"]] f0 --> v1 v2 --"wdt:P31"--> c1 v2 --"wdt:P31"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end