query-812e6a5dcba7945bd152851e65d8c9b4
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?HMBid ?sitelink
WHERE {
?item wdt:P31 wd:Q5.
?item wdt:P21 wd:Q6581072.
?item wdt:P3885 ?HMBid.
OPTIONAL { ?sitelink schema:about ?item } . #any sitelink if present
OPTIONAL { ?ensitelink schema:about ?item ; schema:isPartOf <https://en.wikipedia.org/> } . # enwiki sitelink
FILTER (!BOUND(?ensitelink)) . # does not have enwiki
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?HMBid"):::projected
v1("?ensitelink")
v2("?item"):::projected
v4("?sitelink"):::projected
c8([https://en.wikipedia.org/]):::iri
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c12(["en"]):::literal
c4(["wd:Q6581072"]):::iri
f0[["not bound(?ensitelink)"]]
f0 --> v1
v2 --"wdt:P31"--> c2
v2 --"wdt:P21"--> c4
v2 --"wdt:P3885"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."schema:about".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."schema:about".-> v2
v1 --"schema:isPartOf"--> c8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end