What is the {asteroid} for {named after} of {David Bowie}
Who is the {space rock} for {named after} of {David Bowie}
Who is the {asteroid} for {named after} of {David Bowie}
SELECT DISTINCT ?g WHERE { ?g property:named_after resource:David_Bowie . ?g rdf:type ontology:asteroid }
select distinct ?subj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?subj . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P138> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q5383> . ?subj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q3863> } 
 select distinct ?sbj where { ?sbj wdt:P138 wd:Q5383 . ?sbj wdt:P31 wd:Q3863 } 
342843 Davidbowie