How Create an Individual FactoryHelper

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How Create an Individual FactoryHelper

Christopher
Hi,

I have been trying to create a individual with java classes generated by
Protege. This is into the Factory Class generated by Protege. I talk about
the class that implements CodeGenerationFactory interface. I share the peace
of code when the issue is presented:

    public DifficultyLevel createDifficultyLevel(String name) {
                return delegate.createWrappedIndividual(name,
Vocabulary.CLASS_DIFFICULTYLEVEL, DefaultDifficultyLevel.class);
    }

The fails message in execution time is:

Exception in thread "main" java.lang.NoSuchMethodError:
org.semanticweb.owlapi.search.EntitySearcher.getTypes(Lorg/semanticweb/owlapi/model/OWLIndividual;Ljava/lang/Iterable;)Ljava/util/Collection;
        at
org.protege.owl.codegeneration.inference.SimpleInference.getTypes(SimpleInference.java:224)
        at
org.protege.owl.codegeneration.inference.SimpleInference.canAs(SimpleInference.java:210)
        at
org.protege.owl.codegeneration.impl.FactoryHelper.createWrappedIndividual(FactoryHelper.java:45)
        at GastroOwlApi.RecipeOwl.createDifficultyLevel(RecipeOwl.java:88)
        at
desktoppruebamaven1.DesktopPruebaProject.main(DesktopPruebaProject.java:53)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1
(Exit value: 1)


Thank you in advance.


Best regards, 

Christopher N. Lewis

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: How Create an Individual FactoryHelper

Lorenz Buehmann

OWL API version conflict. Protege works only with OWL API v4, you're using v5

On 10.03.20 14:27, Christopher Lewis wrote:
Hi,

I have been trying to create a individual with java classes generated by
Protege. This is into the Factory Class generated by Protege. I talk about
the class that implements CodeGenerationFactory interface. I share the peace
of code when the issue is presented:

    public DifficultyLevel createDifficultyLevel(String name) {
                return delegate.createWrappedIndividual(name,
Vocabulary.CLASS_DIFFICULTYLEVEL, DefaultDifficultyLevel.class);
    }

The fails message in execution time is:

Exception in thread "main" java.lang.NoSuchMethodError:
org.semanticweb.owlapi.search.EntitySearcher.getTypes(Lorg/semanticweb/owlapi/model/OWLIndividual;Ljava/lang/Iterable;)Ljava/util/Collection;
        at
org.protege.owl.codegeneration.inference.SimpleInference.getTypes(SimpleInference.java:224)
        at
org.protege.owl.codegeneration.inference.SimpleInference.canAs(SimpleInference.java:210)
        at
org.protege.owl.codegeneration.impl.FactoryHelper.createWrappedIndividual(FactoryHelper.java:45)
        at GastroOwlApi.RecipeOwl.createDifficultyLevel(RecipeOwl.java:88)
        at
desktoppruebamaven1.DesktopPruebaProject.main(DesktopPruebaProject.java:53)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1
(Exit value: 1)


Thank you in advance.


Best regards, 

Christopher N. Lewis

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: How Create an Individual FactoryHelper

Christopher
You're right Mr. Buhmann. Thank you very much.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user