Were M3 , M5 , M6 , and M7 edited by a film director that M1 and M2 married and written by M4
SELECT count(*) WHERE {
?x0 a ns:film.director .
?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 .
?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 M2 .
FILTER ( ?x0 != M1 ) .
FILTER ( ?x0 != M2 ) .
M3 ns:film.film.edited_by ?x0 .
M3 ns:film.film.written_by M4 .
M5 ns:film.film.edited_by ?x0 .
M5 ns:film.film.written_by M4 .
M6 ns:film.film.edited_by ?x0 .
M6 ns:film.film.written_by M4 .
M7 ns:film.film.edited_by ?x0 .
M7 ns:film.film.written_by M4
}