what is the {end time} for {Ptolemy I Soter} has {noble title} as {pharaoh} ?
What year did Ptolemy I Soter's rule expire?
When was the end of Ptolemy I Soter's reign as pharaoh?
SELECT ?g WHERE { ?j property:end_time ?g . ?j property:noble_title resource:Pharaoh . resource:Ptolemy_I_Soter property:noble_title ?j }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q168261> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P97> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q37110> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q168261 p:P97 ?s . ?s ps:P97 wd:Q37110 . ?s pq:P582 ?value}