what is the {end time} for {Standard Oil} has {headquarters location} as {New York City} ?
When did Standard Oil move its headquarters location out of NYC?
When Standard Oil ended to be the headquarters location of New York City?
SELECT ?x WHERE { resource:Standard_Oil property:headquarters_location ?m . ?m property:headquarters_location resource:New_York_City . ?m property:end_time ?x }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q375791> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P159> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q60> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q375791 p:P159 ?s . ?s ps:P159 wd:Q60 . ?s pq:P582 ?value}