query-bf408c0c8adf4facaaf8d9fdcabae2d1
Query no. 1
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?e ?label {
VALUES ?e {wd:L7 wd:Q146}.
OPTIONAL{?e wikibase:lemma ?lemma}
OPTIONAL{
?e rdfs:label ?labelDe.
FILTER(LANG(?labelDe) = "de")
}
OPTIONAL{
?e rdfs:label ?labelDeDe.
FILTER(LANG(?labelDeDe) = "de-de")
}
OPTIONAL{
?e rdfs:label ?labelEn.
FILTER(LANG(?labelEn) = "en")
}
BIND(COALESCE(IF(BOUND(?lemma), ?lemma, 1/0),
IF(BOUND(?labelDe), ?labelDe, 1/0),
IF(BOUND(?labelDeDe), ?labelDeDe, 1/0),
IF(BOUND(?labelEn), ?labelEn, 1/0))
AS ?label).
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?e"):::projected
v6("?label"):::projected
v3("?labelDe")
v2("?labelDeDe")
v1("?labelEn")
v5("?lemma")
bind0[/VALUES ?e/]
bind0-->v4
bind00(["wd:L7"])
bind00 --> bind0
bind01(["wd:Q146"])
bind01 --> bind0
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wikibase:lemma".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v2
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v1
end
bind1[/"if(bound(?lemma),?lemma,'1^^xsd:integer' / '0^^xsd:integer')if(bound(?labelDe),?labelDe,'1^^xsd:integer' / '0^^xsd:integer')if(bound(?labelDeDe),?labelDeDe,'1^^xsd:integer' / '0^^xsd:integer')if(bound(?labelEn),?labelEn,'1^^xsd:integer' / '0^^xsd:integer')"/]
v5 --o bind1
v3 --o bind1
v2 --o bind1
v1 --o bind1
bind1 --as--o v6