Closed GoogleCodeExporter closed 8 years ago
Original comment by g.hillairet
on 2 Sep 2010 at 8:52
Original comment by g.hillairet
on 10 Sep 2010 at 10:44
When a EPackage contains one or more sub packages, and you want one owl file
per epackage then you need to use
the Ecore2OWLResources class, as in
http://code.google.com/p/emftriple/source/browse/trunk/examples/com.emf4sw.examp
les/src/com/emf4sw/examples/Example2.java
ResourceSet resourceSet = new ResourceSetImpl(); Resource emfModel =
resourceSet.createResource(URI.createURI("src/ex2.ecore"));
emfModel.load(Collections.EMPTY_MAP);
List<Resource> owlModels = new
Ecore2OWLResources(OWLFormats.OWL).apply(emfModel);
for (Resource resource: owlModels) {
resource.setURI(URI.createURI("src/" + getOntologyName(resource) + ".owl" ));
resource.save(Collections.EMPTY_MAP);
}
Original comment by g.hillairet
on 10 Sep 2010 at 12:58
Original issue reported on code.google.com by
moggi1...@googlemail.com
on 1 Sep 2010 at 7:39