query-d4d5cb1972fd377cfb0345317ab57252
Problem is... I swap "Castillos" for "Iglesias" and the thing goes South, since it delivers a time-out.
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?LabelES
WHERE
{
?item wdt:P31 wd:Q4167836 .
?sitelink schema:about ?item;
schema:isPartOf <https://es.wikipedia.org/> .
?item rdfs:label ?LabelES;
FILTER (lang(?LabelES) = "es") .
FILTER regex (?LabelES, "CategorÃa:Iglesias ").
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?LabelES"):::projected
v2("?item"):::projected
v3("?sitelink")
c7([https://es.wikipedia.org/]):::iri
c4(["wd:Q4167836"]):::iri
f0[["regex(?LabelES,'CategorÃa:Iglesias ')"]]
f0 --> v1
f1[["?LabelES = 'es'"]]
f1 --> v1
v2 --"wdt:P31"--> c4
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c7
v2 --"rdfs:label"--> v1