what is the {end time} for {Asturias} has {head of government} as {Sergio Marqués Fernández} ?
When did Sergio Margues Fernandez of Asturias step down from his role as President?
When did Sergio Marqués Fernández leave his job as President of Asturias?
SELECT ?j WHERE { ?j property:end_time ?j . resource:Asturias property:head_of_government ?j . ?j property:head_of_government resource:Sergio_Marqués_Fernández }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q3934> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P6> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q3181289> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q3934 p:P6 ?s . ?s ps:P6 wd:Q3181289 . ?s pq:P582 ?value}