query-2190dc72f403d96c44fd53d66f9654f3
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?bhl ?bhl_name WHERE {
?item p:P4081 ?bhl_stmt .
?bhl_stmt ps:P4081 ?bhl .
?item wdt:P4081 ?bhl2 .
FILTER (?bhl != ?bhl2) .
OPTIONAL {?bhl_stmt pq:P1810 ?bhl_name} .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY xsd:integer(STRAFTER(str(?item), 'Q')) xsd:integer(?bhl)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?bhl"):::projected
v3("?bhl2")
v5("?bhl_name"):::projected
v4("?bhl_stmt")
v1("?item"):::projected
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?bhl != ?bhl2"]]
f0 --> v2
f0 --> v3
v1 --"p:P4081"--> v4
v4 --"p:statement/P4081"--> v2
v1 --"p:direct/P4081"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P1810".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end