What is {spouse} of {Ferdinand III, Holy Roman Emperor} that is {end time} is {1646-0-0} ?
In 1646, what was the name of the mate of Ferdinand III, Holy Roman Emperor?
In 1646, what was the name of the spouse of Ferdinand III, Holy Roman Emperor?
SELECT ?v WHERE { ?u property:end_time ?p . ?u property:spouse ?v . resource:Ferdinand_III property:spouse ?u . FILTER ( CONTAINS ( YEAR ( ?p ) , '1646' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q150575> .
?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/P582> <1646-0-0>
} 

SELECT ?obj WHERE { wd:Q150575 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1646')) }