query-2b5a116d881bbd3bed3a1e465e9df633

rq turtle/ttl

). (Q5)human (P31)instance of applied to items that have the following claim LIMIT 10), because that way I can execute the query in a given subset of items (e.g. %0The query shown above can also be written as shown in the query below. I like setting the domain of items in a named subquery (see named subquery

Use at

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
{
   {
  SELECT ?e {
    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