What is the {dog} for {has pet} of {Emmanuel Macron}
What is the name of the dog of Emmanuel Macron?
What is the name of Emmanuel Macron's dog ?
SELECT DISTINCT ?w WHERE { ?w rdf:type ontology:dog . resource:Emmanuel_Macron property:has_pet ?w }
select distinct ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q3052772> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1429> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj . ?obj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q144> } 
 select distinct ?obj where { wd:Q3052772 wdt:P1429 ?obj . ?obj wdt:P31 wd:Q144 } 
Nemo