what is the {statement is subject of} for {Alan Jay Lerner} has {award received} as {Academy Award for Best Writing, Adapted Screenplay} ?
For what piece did Alan Jay Lerner win the Oscar for Best Writing and Adapted Screenplay?
For which work did Alan Jay Lerner win Best Writing and Adapted Screenplay at the Academy Awards for?
SELECT ?d WHERE { ?v property:statement_is_subject_of ?d . resource:Alan_Jay_Lerner property:award_received ?v . ?v property:award_received resource:Academy_Award_for_Best_Writing,_Adapted_Screenplay }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q961893> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P166> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q107258> .
?statement <http://www.wikidata.org/entity/P805> ?value. 
} 

SELECT ?value WHERE { wd:Q961893 p:P166 ?s . ?s ps:P166 wd:Q107258 . ?s pq:P805 ?value}