What is {member of sports team} of {Viv Richards} that is {end time} is {1977-0-0} ?
Until 1977-0-0, Viv Richards was part of what athletic team?
What sports team was Viv Richards a member of until 1977-0-0?
SELECT ?r WHERE { FILTER ( CONTAINS ( YEAR ( ?x ) , '1977' ) ) . ?j property:member_of_sports_team ?r . resource:Viv_Richards property:member_of_sports_team ?j . ?j property:end_time ?x }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q738016> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1977-0-0>
} 

SELECT ?obj WHERE { wd:Q738016 p:P54 ?s . ?s ps:P54 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1977')) }