Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Can not create or change ontology to Oracle 11g database

wonderfulseason at gmail.com wonderfulseason at gmail.com
Tue Oct 21 00:44:04 PDT 2008


Hi to all:
        Sorry for my written english.
        I am a Chinese student.I have a serious problem that have puzzled me
for several days.That is, i can not create or ontology into Oracle 11g
database.Here are some details:
        I worked with protege 3.4 beta Build 506.when i try to create a new
owl project to Oracle or convert a file project to database project,i got
the same exception: * **ORA-01400: cannot insert NULL into <my
tableName>.*However,
it worked well with MySql database.I don't know why.
        Actually, i am developing a web protege with protege owl api.Thanks
for your previous hard efford,Everything went well in last two months when i
use the  3.4 beta Build 127 protege.jar and protege-owl.jar.
It seemed that OWLDatabaseModel performed perfect while creating class,
property,individual.When i tryed to create SWRL Rules,OWLDatabaseModel cound
not work with it and i got some warnings. Finally i realized that until
Build 504 ,protege 3.4 cant not support SWRL Rules in the form of
OWLDatabaseModel .So,I changed to use current revision Build 506 protege.jar
and protege-owl.jar.Unfortunately ,i was confronted the problem above.What's
more, Only working with protege Editor i got the same problem.So ,Ii guess
that there are a bugs in the saving process.
        It seems that the problem lies in the difference between difference
between the empty Strng and the null.Mysql treats them as different entity
While Oracle regards them the same. I even try to modify the protege core
source code by allowing the column of tables to be null. It succeeded in
saving ontology to Oracle database ,however, i could't get any information
from the OWLDatabaseModel i extracted from the database,event the default
namespace or class. but it exist in the database and i still got exception
while creating  the sameclass.
       So, i nearly became crazy about it.The earlier.jar version can't
work with swrl rule but it work well with Oracle database.While the latest
.jar satisfy my rule operation perpectly but i did not support oracle 11g.
       BTW,Oracle 11g is the only choice.
       Can anyone give me some advice or solution .Or,there is something
wrong with my oracle database configuration(but it work really well with
Build 127).
       Thank you.!
       by jinlove

       my code is as follows:
       Save:

 CreateOWLDatabaseProjectPlugin creator=new
CreateOWLDatabaseProjectPlugin();
         creator.setKnowledgeBaseFactory(new
OWLDatabaseKnowledgeBaseFactory());
         try{
         if(useMysql){
         creator.setDriver(strDriver);
         creator.setURL(strURL);
         creator.setUsername(strUser);
         creator.setPassword(strPassword); }
         else{
         creator.setDriver(strODriver);
         creator.setURL(strOURL);
         creator.setUsername(strOUser);
         creator.setPassword(strOPassword); }
         creator.setTable(tableName);
         //creator.setOntologyFileURI(new URI("http://www.sjtu.edu.cn/first#
"));
         Project project = creator.createProject();
         OWLModel owlModel =(OWLModel) project.getKnowledgeBase();
         owlModel.getNamespaceManager().setDefaultNamespace("
http://www.sjtu.edu.cn/first#");
                return owlModel;
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
      extract:
     JenaKnowledgeBaseFactory.useStandalone = false;
        Collection errors = new ArrayList();
        OwlDatabaseCreator creator = new OwlDatabaseCreator(false);
        if (useMysql) {
            creator.setDriver(strDriver);
            creator.setURL(strURL);
            creator.setUsername(strUser);
            creator.setPassword(strPassword);
        } else {
            creator.setDriver(strODriver);
            creator.setURL(strOURL);
            creator.setUsername(strOUser);
            creator.setPassword(strOPassword);
        }
        creator.setTable(tableName);
        try {
            creator.create(errors);
            OWLModel owlModel = creator.getOwlModel();
            return owlModel;
        } catch (OntologyLoadException e) {
            e.printStackTrace();
            return null;
        }



***
* *
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20081021/8315e6fd/attachment.html>


More information about the protege-owl mailing list