What is {position held} of {Martin McGuinness} that is {end time} is {2017-1-26} ?
Martin McGuinness will hold what position until January 26, 2017?
What position will Martin McGuinness hold until Januaryn26, 2017?
SELECT ?y WHERE { ?b property:end_time ?x . ?b property:position_held ?y . FILTER ( CONTAINS ( YEAR ( ?x ) , '2017' ) ) . resource:Martin_McGuinness property:position_held ?b }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q57689> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P582> <2017-1-26>
} 

SELECT ?obj WHERE { wd:Q57689 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'2017')) }