query-e13e91188e862af15a2ce1453a4fb6cc
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
- 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 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
- https://www.wikidata.org/wiki/User:Xaris333/Seasons
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2017/07