Did M1 write a film 's sequel and prequel and write M2
SELECT count(*) WHERE {
?x0 ns:film.film.prequel ?x1 .
?x0 ns:film.film.sequel ?x1 .
?x1 a ns:film.film .
M1 ns:film.writer.film ?x0 .
M1 ns:film.writer.film M2
}