query-7ed719cedc53a924b45029ba3f6f4870

rq turtle/ttl

Person suchen, Vor- und Nachname über Liste TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?itemDescription ?born ?died
{
  VALUES (?first ?last)
  {
   ("Robert"@en "Darwin"@en)
   ("Rachel"@en "Carson"@en)
   ("Thomas"@en "Smith"@en)
  }
  BIND (STRLANG(STR(?first), "mul") AS ?first_mul)
  { ?first_name_item wdt:P1705 ?first }
  UNION
  { ?first_name_item wdt:P1705 ?first_mul }

  BIND (STRLANG(STR(?last), "mul") AS ?last_mul)
  { ?last_name_item wdt:P1705 ?last }
  UNION
  { ?last_name_item wdt:P1705 ?last_mul }

  ?item wdt:P31 wd:Q5 . # ?item is human
  ?item wdt:P735 ?first_name_item .
  ?item wdt:P734 ?last_name_item .

  OPTIONAL { ?item wdt:P569 ?born }
  OPTIONAL { ?item wdt:P570 ?died }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?born"):::projected v9("?died"):::projected v1("?first") v3("?first_mul") v4("?first_name_item") v7("?item"):::projected v2("?last") v5("?last_mul") v6("?last_name_item") c9(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?first ?last/] bind0-->v1 bind0-->v2 bind00([sRobert^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind00 --> bind0 bind01([sDarwin^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind01 --> bind0 bind02([sRachel^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind02 --> bind0 bind03([sCarson^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind03 --> bind0 bind04([sThomas^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind04 --> bind0 bind05([sSmith^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]) bind05 --> bind0 bind1[/"STRLANG(str(?first),'mul')"/] v1 --o bind1 bind1 --as--o v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P1705"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P1705"--> v1 end union0r <== or ==> union0l end bind2[/"STRLANG(str(?last),'mul')"/] v2 --o bind2 bind2 --as--o v5 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v6 --"wdt:P1705"--> v5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v6 --"wdt:P1705"--> v2 end union1r <== or ==> union1l end v7 --"wdt:P31"--> c3 v7 --"wdt:P735"--> v4 v7 --"wdt:P734"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P569".-> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P570".-> v9 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end