无法使用Protege导入本体

时间:2016-04-04 19:54:19

标签: owl ontology protege

我正在尝试在我之前创建的Protege中加载早期版本的本体。但是,我使用TutleOntologyParser得到以下错误(我将本体保存为Turtle文件):

uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered " <PNAME_LN> ":isNotGivenCombo "" at line 38, column 1.
Was expecting:
    "." ...

在文本编辑器中打开,这是我从36-40行开始的:

###  http://purl.org/net/ontologyName/isNotGivenCombo

:isNotGivenCombo rdf:type owl:ObjectProperty ;

                           rdfs:subPropertyOf :isNotGiven .

其他解析器会抛出不同的错误。是什么导致了这个问题?我该如何解决?

这是完整的堆栈跟踪:

uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException:在第38行第1列遇到“”:isNotGivenCombo“”。 期待:     “” ...

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

uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleParserException: uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered " <PNAME_LN> ":isNotGivenCombo "" at line 38, column 1.
Was expecting:
    "." ...

    at uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleOntologyParser.parse(TurtleOntologyParser.java:129)
    at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:216)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:868)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:797)
    at org.protege.editor.owl.model.OWLModelManagerImpl.loadOntologyFromPhysicalURI(OWLModelManagerImpl.java:298)
    at org.protege.editor.owl.OWLEditorKit.handleLoadFrom(OWLEditorKit.java:207)
    at org.protege.editor.owl.OWLEditorKit.handleLoadRequest(OWLEditorKit.java:201)
    at org.protege.editor.core.ui.action.OpenAction.openInCurrentWorkspace(OpenAction.java:65)
    at org.protege.editor.core.ui.util.UIUtil.openRequest(UIUtil.java:227)
    at org.protege.editor.core.ui.action.OpenAction.actionPerformed(OpenAction.java:33)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.AbstractButton.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered " <PNAME_LN> ":isNotGivenCombo "" at line 38, column 1.
Was expecting:
    "." ...

    at uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleParser.generateParseException(TurtleParser.java:1968)
    at uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleParser.jj_consume_token(TurtleParser.java:1829)
    at uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleParser.parseDocument(TurtleParser.java:107)
    at uk.ac.manchester.cs.owl.owlapi.turtle.parser.TurtleOntologyParser.parse(TurtleOntologyParser.java:121)
    ... 48 more

1 个答案:

答案 0 :(得分:2)

解决了这个问题。我的基础uri以/结尾,而使用Protege for domains和range生成的URI以#开头。结果,形成的一些URI具有/#,这是不允许的。例如:

www.example.com/#somedomain

要更正错误,我将所有:#替换为:,并将基础uri设置为以#结束,即www.example.com#