What is {instance of} of {Hagia Sophia} that is {end time} is {1931-0-0} ?
What was Hagia Sophia's state in 1931?
Can you describe the state of Hagia Sophia in 1931?
SELECT ?q WHERE { ?m rdf:type ?q . ?m property:end_time ?i . FILTER ( CONTAINS ( YEAR ( ?i ) , '1931' ) ) . resource:Hagia_Sophia rdf:type ?m }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q12506> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1931-0-0>
} 

SELECT ?obj WHERE { wd:Q12506 p:P31 ?s . ?s ps:P31 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1931')) }