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

Timothy Redmond tredmond at stanford.edu
Wed Oct 29 09:32:09 PDT 2008


Sadly we have been having a bit of trouble with the Oracle database  
drivers.  I have been pretty puzzled by this myself but I think I need  
to solve this before the Protege release.  If you know enough about  
Oracle you may be able to proceed by setting custom properties to  
define the types of the columns used in the database when a database  
project is newly configured.  The options that you can set are

	-DDatabase.typename.frame.name.type.'driver name'=...
	-DDatabase.typename.small_integer.'driver name'=...
	-DDatabase.typename.bit.'driver name'=...
	-DDatabase.typename.integer.'driver name'=...
	-DDatabase.typename.short.value.type.'driver name'=...
	-DDatabase.typename.longvarchar.'driver name'=...

where the 'driver name' is the name of the oracle driver.  The default  
values we are using are  as follows:

	"VARCHAR2(1900)",
	"SMALLINT,
	"SMALLINT"
	"INTEGER"
	"VARCHAR2(1900)"
	"LONG",

If you figure  this out let me know what settings you used and I will  
use them as the default for the Oracle database.

-Timothy


On Oct 21, 2008, at 9:44 AM, wonderfulseason at gmail.com wrote:

>
>
> 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;
>         }
>
>
>
>
>
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03




More information about the protege-owl mailing list