what is the {end time} for {Debrecen} has {instance of} as {county town} ?
Debrecen stayed in the county town during what year(s)?
When did Debrecen stay in the county town?
SELECT ?p WHERE { ?u rdf:type ontology:county_town . ?u property:end_time ?p . resource:Debrecen rdf:type ?u }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q79880> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P31> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q1175512> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q79880 p:P31 ?s . ?s ps:P31 wd:Q1175512 . ?s pq:P582 ?value}