Did a spouse of M0 direct , edit , and write a film 's prequel 's sequel
SELECT count(*) WHERE {
?x0 ns:film.director.film ?x1 .
?x0 ns:film.editor.film ?x1 .
?x0 ns:film.writer.film ?x1 .
?x0 ns:people.person.spouse_s/ns:people.marriage.spouse|ns:fictional_universe.fictional_character.married_to/ns:fictional_universe.marriage_of_fictional_characters.spouses M0 .
?x1 ns:film.film.prequel ?x2 .
?x2 ns:film.film.sequel ?x3 .
?x3 a ns:film.film .
FILTER ( ?x0 != M0 )
}