What is {local dialing code} of {Ho Chi Minh City} that is {end time} is {2017-7-16} ?
With an end time of 2017-7-16  what is the area code for Ho Chi Minh City ?
What is local dialing code of Ho Chi Minh City that has end time is 2017-7-16 ?
SELECT ?f WHERE { ?e property:end_time ?r . resource:Ho_Chi_Minh_City property:local_dialing_code ?e . ?e property:local_dialing_code ?f . FILTER ( CONTAINS ( YEAR ( ?r ) , '2017' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1854> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P473> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <2017-7-16>
} 

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