query-06e3be5e849fb549b57aa90d837ab305
Cannot get simple qualifier value of P31, plus: timeouts …. This reliably runs in a timeout. So I started without the first "wdt:P31/wdt:279*" and created some unions of subclasses, like (Q365)Cologne ) of (P131)located in the administrative territorial entity in any admin level ((Q16970)church building . Simple, isn't it? Actually, I need all subclasses of (Q365)Cologne in (Q16970)church building I would like to query a list of
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 ?enddate WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
#hint:Query hint:optimizer "None" (I thought this is the magic bullet against timeout?)
{?item wdt:P31 wd:Q16970.} # [[d:Q16970|church building <small>(Q16970)</small>]]
UNION
{?item wdt:P31 wd:Q317557} #[[d:Q317557|parish church <small>(Q317557)</small>]]
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q16970"]):::iri
c7(["wd:Q317557"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c6
end
union0r <== or ==> union0l
end