What is {member of sports team} of {Kevin Keegan} that is {end time} is {1982-1-1} ?
For which team did Kevin Keegan play until 1982?
What team did Kevin Keegan play for until 1982-1-1?
SELECT ?z WHERE { resource:Kevin_Keegan property:member_of_sports_team ?j . ?j property:end_time ?b . FILTER ( CONTAINS ( YEAR ( ?b ) , '1982' ) ) . ?j property:member_of_sports_team ?z }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q152832> .
?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> <1982-1-1>
} 

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