What was directed by M1 's editor and written by a spouse of M0 's director
SELECT DISTINCT ?x0 WHERE {
?x0 ns:film.film.directed_by ?x1 .
?x0 ns:film.film.written_by ?x2 .
?x1 ns:film.editor.film M1 .
?x2 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 .
?x3 ns:film.director.film M0 .
FILTER ( ?x2 != ?x3 )
}