[protege-owl] from OWL to Database with protegeOWL API
I don't have the answer yet.
I have find this function:
I try the following, but it doesn't work:
String uri = "http://www.biopax.org/release/biopax-level2.owl";
JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);
Collection errors = new ArrayList();
OWLDatabaseKnowledgeBaseFactory kb = new OWLDatabaseKnowledgeBaseFactory();
// here I think we load the my owlModel knowledge base in the database
// knowledge base factory
kb.loadKnowledgeBase(owlModel, "com.mysql.jdbc.Driver", "Thesaurus",
"jdbc:mysql://localhost:3306/test", "login", "password", errors);
And the output is:
CONFIG: Protege 3.2 Build 300, JVM 1.5.0_06-b05, memory=1040M, Windows
2000, encoding=UTF-8, language=en, country=US
WARNING: Plugins directory not found: C:\Program
[ProtegeOWLParser] Completed triple loading after 688 ms
[TripleChangePostProcessor] Completed lists after 0 ms
[TripleChangePostProcessor] Completed anonymous classes after 15 ms
[TripleChangePostProcessor] Completed deprecated classes after 0 ms
[TripleChangePostProcessor] Completed properties after 32 ms
[TripleChangePostProcessor] Completed named classes after 0 ms
... Loading completed after 797 ms
WARNING: Unable to load knowledgebase -- java.lang.NullPointerException
I have MySql database and mysql-connector-java-3.1.12 driver is at the
I think we have to know how to load a knowledge base at
the OWLDatabaseModel, and then how to save it.
The problem is the I can not find the documentation, and
it is very diffecult to find the needed functions from
java doc of Protege.
With beste regards,
Amelie Marseille [MSc BIX] wrote:
> Hello Julia,
> I saw your mail from the protege mailing list. Did you get your answer?
> I am triying to do the same this as you, but with my own ontology.
Then I want to use a reasoner.
> I think you need to have a mysql database (or other) and also the
driver (a connector .jar) that you can all download from the mysql web
site. You need to add the jar to the classpath. The database URI, I
guess it is something like
> I tried the code that you gave (with the OWLDatabaseModel
contructor), but i can't understand why, it says that this contructor
doesn't exist in the class
> Do you have a hint ?