query-0c585e36d757804c687738780c1e902e
List of theatres (venues), with their various type statements (in descending order of the number of types)Maintenance tasks: .(Q41253)movie theater statement referring to (P31)instance of do not require another (Q786922)drive-in theater ; thus items of the type (Q41253)movie theater , which is in turn a subclass of (Q1454553)outdoor cinema is a subclass of (Q786922)drive-in theater statements that refer to a superclass of any of the other types. Example: (P31)instance of Remove any statements that refer to an organization. Create a separate item for the organization (sometimes you may want to proceed the other way round, creating a new item for the theatre building; you may also inspect the list of reverse statements to see to which type incoming statements predominantly refer to).(P31)instance of Remove any
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#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item
?itemLabel
?countryLabel
(replace(group_concat(distinct ?type;separator="; "), "http://www.wikidata.org/entity/", "") as ?types) #Strip the path in order to get only the Q-number.
(group_concat(distinct ?typeLabel_en;separator="; ") as ?typeLabels_en)
WHERE
{
?item wdt:P31/wdt:P279* wd:Q24354.
?item wdt:P31 ?type.
?item wdt:P17 wd:Q39.
OPTIONAL { ?item wdt:P31/rdfs:label ?typeLabel_en . FILTER (lang(?typeLabel_en) = "en") }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
group by ?item #List all the variables for which the values are not concatenated!
?itemLabel
?countryLabel
order by desc (COUNT(?type))