what is the {start time} for {Kingdom of Castile} has {instance of} as {historical country} ?
Kingdom of Castile was establihed when?
When was the Kingdom of Castile established?
SELECT ?d WHERE { resource:Kingdom_of_Castile rdf:type ?b . ?b property:start_time ?d . ?b rdf:type ontology:historical_country }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q179293> .
?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> <http://wikidata.dbpedia.org/resource/Q3024240> .
?statement <http://www.wikidata.org/entity/P580> ?value. 
} 

SELECT ?value WHERE { wd:Q179293 p:P31 ?s . ?s ps:P31 wd:Q3024240 . ?s pq:P580 ?value}