what is the {end time} for {Muhammad} has {religion} as {Hanif} ?
From which year did Muhammad stop practicing the Hanif religion?
When did Muhammad stop practicing the Hanif religion?
SELECT ?w WHERE { resource:Muhammad property:religion ?v . ?v property:religion resource:Hanif . ?v property:end_time ?w }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q9458> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P140> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q425381> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q9458 p:P140 ?s . ?s ps:P140 wd:Q425381 . ?s pq:P582 ?value}