I'm using the Wikidata SPARQL Query Service with the following query:
SELECT ?item ?itemLabel ?class ?classLabel ?projectLabel WHERE {
VALUES ?item { wd:Q1 wd:Q367204 }
?item wdt:P31 ?class;
wdt:P18 ?project.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". } }
When running the query there is a result for Q1
because there is an image, but there is no result for Q367204
because there isn't an image.
My question: How can I get results for both Q1 and Q367204 regardless if there is an image available or not?