What is {professional or sports partner} of {Edward Anthony} that is {end time} is {1865-0-0} ?
Who was Edward Anthony's partner until 1865?
Who was Edward Anthony's partner when their partnership ended in 1865?
SELECT ?h WHERE { resource:Edward_Anthony property:partner_in_business_or_sport ?g . FILTER ( CONTAINS ( YEAR ( ?r ) , '1865' ) ) . ?g property:end_time ?r . ?g property:partner_in_business_or_sport ?h }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q5341576> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1327> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1865-0-0>
} 

SELECT ?obj WHERE { wd:Q5341576 p:P1327 ?s . ?s ps:P1327 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1865')) }