what is the {end time} for {Edward Brooke} has {position held} as {Massachusetts Attorney General} ?
On what date did Edward Brooke finish his position as Massachusetts' Attorney General?
When did Edward Brooke finish his position as Massachusetts' Attorney General?
SELECT ?h WHERE { ?v property:position_held resource:Massachusetts_Attorney_General . resource:Edward_Brooke property:position_held ?v . ?v property:end_time ?h }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q3276635> .
?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/Q3406492> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q3276635 p:P39 ?s . ?s ps:P39 wd:Q3406492 . ?s pq:P582 ?value}