query-42263725cdced3ae649b53c469845bfc

rq turtle/ttl

Query for specific string with variables

Use at

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#>
SELECT * WHERE {
  BIND("Douglas Adams"@en as ?name1)  BIND(strafter(?name1, " ") as ?name)  #slow
  OPTIONAL { ?lastname wdt:P31 wd:Q101352 ; rdfs:label ?name }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?lastname"):::projected v2("?name"):::projected v1("?name1"):::projected c2(["wd:Q101352"]):::iri bind0[/"sDouglas Adams^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>'"/] bind0 --as--o v1 bind1[/"substring-after(?name1,' ')"/] v1 --o bind1 bind1 --as--o v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P31".-> c2 v3 --"rdfs:label"--> v2 end