Was M1 directed by a film director , directed by M2 , and written by a film director
SELECT count(*) WHERE {
?x0 a ns:film.director .
?x1 a ns:film.director .
M1 ns:film.film.directed_by ?x1 .
M1 ns:film.film.directed_by M2 .
M1 ns:film.film.written_by ?x0
}