srirammails / emftriple

Automatically exported from code.google.com/p/emftriple
0 stars 0 forks source link

No transformation of eSubpackages from ecore to OWL RDF/XML Syntax #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an ecore File with a "ecore:EPackage" and at least one "eSubpackages".
2.Choose "Ecore to OWL RDF/XML Syntax (.owl)"

What is the expected output? What do you see instead?
You should get one file for each eSubpackage and one file for the EPackage, but 
instead you get just the file for the EPackage 

What version of the product are you using? On what operating system?
I'm using emftriple 0.6.1.201009010928 and eclipse 3.6 on windows 7.

Please provide any additional information below.

Transformation to OWL Turtle Syntax and OWL Model is correct

Original issue reported on code.google.com by moggi1...@googlemail.com on 1 Sep 2010 at 7:39

GoogleCodeExporter commented 8 years ago

Original comment by g.hillairet on 2 Sep 2010 at 8:52

GoogleCodeExporter commented 8 years ago

Original comment by g.hillairet on 10 Sep 2010 at 10:44

GoogleCodeExporter commented 8 years ago
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