query-68c5d6211ee6a28cc09e8751fd10f02c
Manfred Werner (WMAT)TagishsimonWikidata:SPARQL query service/query optimization#Inverse property paths
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT DISTINCT ?museum
WHERE
{
wd:Q33506 ^wdt:P279*/^wdt:P31 ?museum . # searching for museum inluding its subclasses
?museum wdt:P131+ wd:Q1356. # location is in West Bengal or a sudivision
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?museum"):::projected
a1((" "))
c2(["wd:Q33506"]):::iri
c5(["wd:Q1356"]):::iri
a1 --"wdt:P279"--> c2
v1 --"wdt:P31"--> a1
v1 --"wdt:P131"--> c5