What is the {written work} for {collection} of {Bill Gates}
What collection did Bill Gates write for?
Bill Gates wrote what for what collection?
SELECT DISTINCT ?y WHERE { ?y rdf:type ontology:written_work . ?y property:collection resource:Bill_Gates }
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/P195> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q5284> . ?subj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q47461344> } 
 select distinct ?sbj where { ?sbj wdt:P195 wd:Q5284 . ?sbj wdt:P31 wd:Q47461344 } 