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-discussion] C#, OWL & SAVE ISSUE!

Alaa Tadmori alaatadmori at yahoo.com
Thu Aug 20 00:19:35 PDT 2009


Hello everyone,
I am an asp.net developer; I have been trying to use the Jena library to make a use of Semantic Web. As you know, Jena is Java based (I don’t know much JavaL) so I tried to transfer the library to C# to be able to work against it using asp.net. Everything was going just fine, I was able to programmatically input the ontology, add, edit & delete new classes & instances & query it. Almost in the end, as expected, I needed a way to save the in-memory ontology I have created or modified, I tried:
ontModel.writeAll(outputStream, null, null) (with all its vairations) But it didn’t work out. 
When I checked your mainling list I found that many people are asking this question, like how to save the ontology or how to save the inferred statements, the answer was to use
 jenaOWLModel.save(…)
Here when everything got worse, I needed to transfer the new library ( protégé-owl )  which contains the JenaOWLModel so I get the save command while I should still keep working with the old one (Jena Ontology) because the JenaOWLModel.save takes the OntModel as one of it argurments to save the ontology...
The problem is that when I transfered both of the libraries and imported them to Visual Studio they seem to conflict with each other. To cut it short (I’m sorry that it is already long) these were my unsuccessful solutions:
1.       Use ontModel.writeAll(…) Doesn’t save any new additions in case I upload the ontology from a URI, it only writes the model itself.

2.       Import the Protégé-owl library and keep the old one; I am getting coflict between the tow libraries.. (ex: Interface Statement exists in both edu.stanford.smi.protegex.owl.jena & com.hp.hpl.jena.ontology) 
3.       Work only with Protégé-owl library (this seems to be perfect soultion, but unfortuantely I getting this error: 
org.apache.xerces.parsers.SAXParser.<init>(Lorg.apache.xerces.xni.parser.XMLParserConfiguration;)V 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: java.lang.NoSuchMethodError: org.apache.xerces.parsers.SAXParser.<init>(Lorg.apache.xerces.xni.parser.XMLParserConfiguration;)V
Source Error: 
Line 23:     public static void GetModel(string filePath)
Line 24:     { 
Line 25:             model = ModelFactory.createOntologyModel();
Line 26: 
Line 27:             inputstream = FileManager.get().open(filePath);
(This error drove me crazy, please Java foxes what is this: 
java.lang.NoSuchMethodError: org.apache.xerces.parsers.SAXParser.<init>(Lorg.apache.xerces.xni.parser.XMLParserConfiguration;)V
 
An important thing to mention is that I’m transferring the library of Jena Ontology using the zip file that contains all the jar files of the API but for the protégé-owl I coun’t find such a thing, I transferred the library using the jar files I found in the Protege_3.3.1\plugins folder (I also tried protégé 4 API found in this page http://protege.stanford.edu/download/protege/4.0/zip/?C=N;O=D Is this what i need?!). I do the transfer using “ikvm-0.34.0.2”.
So this is my problem which I’m trying to solve for over than 3 weaks, more than 7 hours a day. I hope you have a solution or any recommendation on how to solve this tricky problem.
I appreciate your patience, thank you so much for your cooperation.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20090820/6c023c77/attachment.html>


More information about the protege-discussion mailing list