Search code examples
javajenasemantic-webontologyprotege

Apache Jena save ontology file then opening it in Protégé2000


I opened my ontology .owl (already created in protégé2000 v5) in Protégé2000 v5. Then using java Apache Jena Framework, i save the same ontology on the same file (without any modifications done). I go back to Protégé2000 Which asks me to reload the ontology because it was modified by another program, so i confirm. I notice that : the number of axioms is less than it must be and i get this exception (in PROTEGE) :

UnknownOWLOntologyException: Unknown ontology: OntologyID(OntologyIRI(<http://www.ontology>))

Can anyone please tell me what's the issue here ?


Solution

  • Finally i found where the problem is. When saving using Jena, the URI changes (Jena just gave the URI starting with my file reference in the hard drive, what wasen't initially) even if this URI worked with every treatment done to the ontology. So the solution was not to mention the URI while saving it so that Jena doesn't add the full path.