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