what is the {author} for {Hamilton} has {based on} as {Alexander Hamilton} ?
Which author wrote the story, Hamilton, based of Alexander Hamilton?
The story Hamilton, based on Alexander Hamilton, was written by what author?
SELECT ?k WHERE { ?z property:based_on resource:Alexander_Hamilton . ?z property:author ?k . resource:Hamilton property:based_on ?z }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q19320959> .
?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> <http://wikidata.dbpedia.org/resource/Q54016147> .
?statement <http://www.wikidata.org/entity/P50> ?value. 
} 

SELECT ?value WHERE { wd:Q19320959 p:P144 ?s . ?s ps:P144 wd:Q54016147 . ?s pq:P50 ?value}