Write GenerateOntologies.java based on Amar's code