What is {spouse} of {James VI and I} that is {point in time} is {1589-11-23} ?
In Octover 1589 James VI and I married who?
Who were James VI and I married to on October 23rd,1589
SELECT ?m WHERE { ?r property:spouse ?m . FILTER ( CONTAINS ( YEAR ( ?a ) , '1589' ) ) . ?r property:point_in_time ?a . resource:James_VI_and_I property:spouse ?r }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q79972> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P26> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P585> <1589-11-23>
} 

SELECT ?obj WHERE { wd:Q79972 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P585 ?x filter(contains(YEAR(?x),'1589')) }