query-54ebc9c81ef1f22d0d4ef65909beeb09

rq turtle/ttl

Show label, occupation and image of the persons that are born on certain date SELECT DISTINCT ?person ?personLabel ?dob ?occupation ?occupationLabel ?image with { SELECT DISTINCT ?person WHERE { ?person wdt:P569 ?dob . FILTER (?dob = "1999-05-19"^^xsd:dateTime) } } as %i where { include %i ?person wdt:P31 wd:Q5 . ?person wdt:P106 ?occupation . ?person wdt:P18 ?image . # Query reaches timeout, thought if I add OPTIONAL it works even s,o that this way it has to show more results. How is this possible, and how to make it work without OPTIONAL? SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
#Show label, occupation and image of the persons that are born on certain date 
SELECT DISTINCT ?person ?personLabel ?dob ?occupation ?occupationLabel ?image where
{
   {
SELECT DISTINCT ?person 
WHERE
{
 ?person wdt:P569 ?dob .
 FILTER (?dob = "1999-05-19"^^xsd:dat)
  } } ?person wdt:P31 wd:Q5 .
 ?person wdt:P106 ?occupation .
 ?person wdt:P18 ?image .       # Query reaches timeout, thought if I add OPTIONAL it works even s,o that this way it has to show more results. How is this possible, and how to make it work without OPTIONAL? 
 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; v1("?dob"):::projected v4("?image"):::projected v3("?occupation"):::projected v2("?person"):::projected c8(["bd:serviceParam"]):::iri c4(["wd:Q5"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?dob = s1999-05-19^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f0 --> v1 v2 --"wdt:P569"--> v1 v2 --"wdt:P31"--> c4 v2 --"wdt:P106"--> v3 v2 --"wdt:P18"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end