what is the {end time} for {Pedro Martinez} has {member of sports team} as {Boston Red Sox} ?
Give me the date Pedro Martinez stopped playing for the Boston Red Sox.
When did Pedro Martinez stop playing for the Boston Red Sox?
SELECT ?h WHERE { ?n property:member_of_sports_team resource:Boston_Red_Sox . ?n property:end_time ?h . resource:Pedro_Martinez property:member_of_sports_team ?n }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q726918> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P54> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q213959> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q726918 p:P54 ?s . ?s ps:P54 wd:Q213959 . ?s pq:P582 ?value}