query-cc62a5ab7487666e072d094e406f0d79
TODO
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 ?castleLabel ?registerLabel ?link WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
{
SELECT DISTINCT ?castle ?register ?link WHERE {
?register wdt:P31/wdt:P279* wd:Q18618628.
?register wdt:P17 wd:Q145.
?register wdt:P1630 ?URLprefix.
?register wikibase:directClaim ?pred .
?castle wdt:P31/wdt:P279* wd:Q23413.
?castle wdt:P7959 wd:Q67479626.
?castle ?pred ?entry .
BIND(URI(REPLACE(?URLprefix, "\\$1", STR(?entry))) AS ?link)
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?URLprefix")
v4("?castle")
v5("?entry")
v6("?link"):::projected
v3("?pred")
v1("?register")
a1((" "))
a2((" "))
c14(["wd:Q67479626"]):::iri
c12(["wd:Q23413"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;"]):::literal
c7(["wd:Q18618628"]):::iri
c9(["wd:Q145"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c7
v1 --"wdt:P17"--> c9
v1 --"wdt:P1630"--> v2
v1 --"wikibase:directClaim"--> v3
v4 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c12
v4 --"wdt:P7959"--> c14
v4 -->v3--> v5
bind0[/"replace(?URLprefix,'\$1',str(?entry))"/]
v2 --o bind0
v5 --o bind0
bind0 --as--o v6