Did a actor write a prequel of M3 , direct M2 , and write M1
SELECT count(*) WHERE {
?x0 a ns:film.actor .
?x0 ns:film.director.film M2 .
?x0 ns:film.writer.film ?x1 .
?x0 ns:film.writer.film M1 .
?x1 ns:film.film.sequel M3
}