What is the {written work} for {based on} of {Forrest Gump}
Who is the {composed work} for {based on} of {Forrest Gump}
Who is the {written work} for {based on} of {Forrest Gump}
SELECT DISTINCT ?b WHERE { ?b rdf:type ontology:written_work . resource:Forrest_Gump property:based_on ?b }
select distinct ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q134773> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P144> . ?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/Q47461344> } 
 select distinct ?obj where { wd:Q134773 wdt:P144 ?obj . ?obj wdt:P31 wd:Q47461344 } 
Forrest Gump