Thank you for your answer!
[1]
https://github.com/udbxu/emf4sw/blob/master/examples/
com.emf4sw.owl.examples/src/WikiOWL.owl
[2]
https://github.com/udbxu/emf4sw/blob/master/examples/
com.emf4sw.owl.examples/src/com/emf4sw/owl/examples/wiki/
WikiRDF2EcoreModel.java
[3]
https://github.com/udbxu/emf4sw/blob/master/examples/
com.emf4sw.owl.examples/src/WikiOWL.ecore
[4]
https://github.com/udbxu/emf4sw/blob/master/examples/
com.emf4sw.owl.examples/src/com/emf4sw/owl/examples/wiki/
WikiOWL2Ecore.java
[5]
https://github.com/udbxu/emf4sw/blob/master/examples/
com.emf4sw.owl.examples/src/WikiRDF.rdf
Yes, i do have registred my own "WikiOWL.ecore"[3] in the code (as
same as your example) : WikiRDF2EcoreModel.java [2].
While "WikiOWL.owl"[1] is my owl data (exported from a Wiki tools SMW
+), I transformed it to a "WikiOWL.ecore"[3]
with the code here [4].
I don't know whether if "WikiOWL.ecore"[3] is vaild model or not, but
it can be opened with 'Sample Ecore Model Editor' in Eclipse. And
there is acutally a
a EPackage like <ecore:EPackage> .... </ecore:EPackage> as a root
element.
WikiRDF.rdf[5] is the RDF data i want to translate into instances of
WikiRDF.ecore. It is also a Export of the Wiki tools SMW+. Can it be
the problem, if it is a invaild model instance?
BRs
Rafiki
On 6 Apr., 11:56, Guillaume Hillairet <
g.hillai...@gmail.com> wrote:
> There is maybe something wrong with the registration of models. In your case you should have
> something like this in your code:
>
> Models.register(Models.resource("wiki.ecore", true));
>
> RDF2Model r2m = new RDF2Model(Models.resource("wiki.ecore", true));
> Resource model = r2m.transform(Models.resource("wiki.rdf", true));
>
> Where wiki.ecore is the Ecore model you have obtained have execution of OWL2Ecore on your wiki
> ontology and wiki.rdf is the RDF data you want to translate into instances of wiki.ecore.
>
> Now before executing RDF2Model you may want to check that wiki.ecore is a valid model. The transformation
> OWL2Ecore does not give you a valid Ecore model each time, it really depends on the complexity of the ontology.
> So make sure that wiki.ecore contains the classes and attributes/references you need to get a model from your RDF
> data.
>
> You can also add annotations on your Ecore model to tell the RDF2Model transformation what to look at. See this example of
> Ecore model with annotations:
https://github.com/ghillairet/emf4sw/blob/master/examples/com.emf4sw.....
>
> BRs,
> Guillaume