What was written by a writer of M1 , produced by M0 , and edited by a costume designer 's Canadian spouse
SELECT DISTINCT ?x0 WHERE {
?x0 ns:film.film.edited_by ?x1 .
?x0 ns:film.film.produced_by|ns:film.film.production_companies M0 .
?x0 ns:film.film.written_by ?x2 .
?x1 ns:people.person.nationality ns:m.0d060g .
?x1 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses ?x3 .
?x2 ns:film.writer.film M1 .
?x3 a ns:film.film_costumer_designer .
FILTER ( ?x1 != ?x3 )
}