What is {position held} of {Barack Obama} and {elected in}
What role was once held by using Obama, and when was once this function held?
What position was held by Obama, and when was this position held?
SELECT ?o ?w WHERE { resource:Barack_Obama property:position_held ?d . ?d property:elected_in ?o . . ?d property:position_held ?w }
select distinct ?dataprop1 ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q76> . ?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/P580> ?dataprop1 . } 
SELECT ?value1 ?obj WHERE { wd:Q76 p:P39 ?s . ?s ps:P39 ?obj . ?s pq:P2715 ?value1 . }