What is {position held} of {Muammar al-Gaddafi} that is {end time} is {2010-1-31} ?
What position did Muammar Al-Gaddafi have in 2010?
what position did muammar al-gaddafi hold in 2010-1-31?
SELECT ?r WHERE { ?b property:position_held ?r . ?b property:end_time ?o . resource:Muammar_Gaddafi property:position_held ?b . FILTER ( CONTAINS ( YEAR ( ?o ) , '2010' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q19878> .
?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> <2010-1-31>
} 

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