Did M2 produce M1 's sequel and write M0 's prequel
SELECT count(*) WHERE {
?x0 ns:film.film.sequel M0 .
?x1 ns:film.film.prequel M1 .
M2 ns:film.producer.film|ns:film.production_company.films ?x1 .
M2 ns:film.writer.film ?x0
}