what is the {end time} for {Shirley Temple} has {position held} as {United States Ambassador to Ghana} ?
How long was Shirley Sanctuary the Joined together States Minister to Ghana?
How long was Shirley Temple the United States Ambassador to Ghana?
SELECT ?f WHERE { resource:Shirley_Temple property:position_held ?g . ?g property:end_time ?f . ?g property:position_held resource:United_States_Ambassador_to_Ghana }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q182580> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q7889302> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q182580 p:P39 ?s . ?s ps:P39 wd:Q7889302 . ?s pq:P582 ?value}