Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to load a different version of an ontology in the same window #357

Closed
csnyulas opened this issue Mar 8, 2016 · 6 comments

Comments

@csnyulas
Copy link
Member

csnyulas commented Mar 8, 2016

To reproduce:

  1. Open an ontology in Protege
  2. Try to open either the same ontology file again or another version of that ontology (having the same ontology IRI), and asked whether you want to open the new ontology in the current window, choose "Yes"
    screenshot open in same window dialog
  3. The following error message is shown (see the details below):
    screenshot protege_error_openinsamewindow

Note: This is a long standing issue, inherited from Protege 4, which can be very annoying, especially if people don't know why they are getting this error.

Desired behaviour: In case someone is trying to open an ontology that is already opened in the current workspace (or different version of the same ontology), the common sense behaviour would be to replace the content in the workspace with the newly opened ontology content, or if there are unsaved changes, at least ask the user to decide what should Protege do with the currently loaded ontology.

Details:
This is the error message we get

Ontology already exists. OntologyID(OntologyIRI(<http://protege.stanford.edu/ontologies/groceries>) VersionIRI(<null>))

And here is the stack trace:

Ontology already exists. OntologyID(OntologyIRI(<http://protege.stanford.edu/ontologies/groceries>) VersionIRI(<null>))


Full Stack Trace
-----------------------------------------------------------------------------------------

org.semanticweb.owlapi.model.OWLOntologyAlreadyExistsException: Ontology already exists. OntologyID(OntologyIRI(<http://protege.stanford.edu/ontologies/groceries>) VersionIRI(<null>))
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1048)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:972)
    at org.protege.editor.owl.model.OWLModelManagerImpl.loadOntologyFromPhysicalURI(OWLModelManagerImpl.java:278)
    at org.protege.editor.owl.OWLEditorKit.handleLoadFrom(OWLEditorKit.java:201)
    at org.protege.editor.owl.OWLEditorKit.handleLoadRecentRequest(OWLEditorKit.java:189)
    at org.protege.editor.core.ui.action.OpenRecentAction$RecentEditorKitAction.openInCurrentWorkspace(OpenRecentAction.java:95)
    at org.protege.editor.core.ui.util.UIUtil.openRequest(UIUtil.java:221)
    at org.protege.editor.core.ui.action.OpenRecentAction$RecentEditorKitAction.actionPerformed(OpenRecentAction.java:76)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6525)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6290)
    at java.awt.Container.processEvent(Container.java:2234)
    at java.awt.Component.dispatchEventImpl(Component.java:4881)
    at java.awt.Container.dispatchEventImpl(Container.java:2292)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
    at java.awt.Container.dispatchEventImpl(Container.java:2278)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4703)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:751)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:702)
    at java.awt.EventQueue$3.run(EventQueue.java:696)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:724)
    at java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:721)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: org.semanticweb.owlapi.model.OWLOntologyRenameException: Could not rename ontology. An ontology with this ID already exists: OntologyID(OntologyIRI(<http://protege.stanford.edu/ontologies/groceries>) VersionIRI(<null>))
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.checkForOntologyIDChange(OWLOntologyManagerImpl.java:721)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.enactChangeApplication(OWLOntologyManagerImpl.java:555)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.applyChanges(OWLOntologyManagerImpl.java:583)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.applyChange(OWLOntologyManagerImpl.java:671)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.applyChange(OWLRDFConsumer.java:652)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$TypeOntologyHandler.handleTriple(TripleHandlers.java:2864)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.handleStreaming(TripleHandlers.java:183)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.statementWithResourceValue(OWLRDFConsumer.java:1507)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParser.statementWithResourceValue(RDFParser.java:365)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.NodeElement.startElement(StartRDF.java:331)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.NodeElementList.startElement(StartRDF.java:399)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParser.startElement(RDFParser.java:196)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:356)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParser.parse(RDFParser.java:140)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:73)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:212)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1035)
    ... 45 more
@MengtianYin
Copy link

Hi, I face the same issue. Have u solved it?

@pafournier
Copy link

I finaly guess I face this problem everytime I forget to launch the reasoner before closing Protégé 5. 5.0, although it seems to me it was not the case previously (meanwhile I loaded and installed proposed add on recently).
As I am facing another time this situation my latest rdf ontology version is empty : any idea to reactivate the file opening capacity. ? Thank you.

@danielbakas
Copy link

I'm having the same issue when trying to import RDFS 😢

@marimeireles
Copy link

Hi, having the same issue why is this closed? Is there some solution marked somewhere else?

I'm getting the same error.

Here is some more information: I've stashed all my changes, so the file that used to be able to be opened by Protege is not being opened anymore and still throwing the same error.
It seems to me like it's some sort of full cache problem with protege?

Another problem is that my error log is truncated so I can't properly follow all that's happening.

@marimeireles
Copy link

I've read the rest of "similar" issues on GH and none of them attend to my specific problem.
I see there's a commit related to this issue. Maybe I should open a new one?
Though it is the same error message...

@marimeireles
Copy link

Okay, so the problem in my case was that because I got an error in the previous time I was importing my TTL my XML got misformatted and that messed everything up.
The good news is, just erasing that and running Protege again will generate a new one for you that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants