Did a screenwriter that M1 married write and direct a film
SELECT count(*) WHERE {
?x0 a ns:film.writer .
?x0 ns:film.director.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 M1 .
?x1 a ns:film.film .
FILTER ( ?x0 != M1 )
}