query-02a42dbc91ef5f22121c299b1a99bc8d
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?countryLabel WHERE {
VALUES ?item {
wd:Q1479520
wd:Q28531806
wd:Q54823850
wd:Q60063834
wd:Q56191866
wd:Q2602068
wd:Q204389
}
optional { ?item wdt:P27 ?nation.
optional {?nation rdfs:label ?nationLabel . filter(lang(?nationLabel)="en") } }
bind(coalesce(?nationLabel,"-empty-") as ?countryLabel)
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,[AUTO_LANGUAGE]". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?countryLabel"):::projected
v1("?item"):::projected
v3("?nation")
v2("?nationLabel")
c5(["bd:serviceParam"]):::iri
c7(["de,#91;AUTO_LANGUAGE#93;"]):::literal
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q1479520"])
bind00 --> bind0
bind01(["wd:Q28531806"])
bind01 --> bind0
bind02(["wd:Q54823850"])
bind02 --> bind0
bind03(["wd:Q60063834"])
bind03 --> bind0
bind04(["wd:Q56191866"])
bind04 --> bind0
bind05(["wd:Q2602068"])
bind05 --> bind0
bind06(["wd:Q204389"])
bind06 --> bind0
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P27".-> v3
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:label".-> v2
end
end
bind1[/"?nationLabel'-empty-'"/]
v2 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end