我正在尝试使用 OWL API 运行 DL 查询,使用 DL 查询示例(http://sourceforge.net/p/owlapi/code/ci/aef6981535f07a2d0d44c394b9f4d5415f36025a/tree/contract/src/test/java/org/coode /owlapi/examples/DLQueryExample.java )
hasExperience some (Experience and hasYearsOfExperience some int[>=1])
这运行良好并在 Protege 中显示预期结果,但在 Java 中返回以下错误:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Prefix not registered for prefix name: :
at org.semanticweb.owlapi.util.DefaultPrefixManager.getIRI(DefaultPrefixManager.java:199)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.getIRI(ManchesterOWLSyntaxEditorParser.java:3112)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.getOWLDatatype(ManchesterOWLSyntaxEditorParser.java:563)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseDataRangePrimary(ManchesterOWLSyntaxEditorParser.java:1032)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseDataUnionOf(ManchesterOWLSyntaxEditorParser.java:1013)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseDataIntersectionOf(ManchesterOWLSyntaxEditorParser.java:995)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseDataRange(ManchesterOWLSyntaxEditorParser.java:988)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseDataRestriction(ManchesterOWLSyntaxEditorParser.java:908)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseNonNaryClassExpression(ManchesterOWLSyntaxEditorParser.java:787)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseUnion(ManchesterOWLSyntaxEditorParser.java:688)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseIntersection(ManchesterOWLSyntaxEditorParser.java:663)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseNestedClassExpression(ManchesterOWLSyntaxEditorParser.java:1212)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseObjectRestriction(ManchesterOWLSyntaxEditorParser.java:819)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseNonNaryClassExpression(ManchesterOWLSyntaxEditorParser.java:783)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseUnion(ManchesterOWLSyntaxEditorParser.java:688)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseIntersection(ManchesterOWLSyntaxEditorParser.java:663)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseNestedClassExpression(ManchesterOWLSyntaxEditorParser.java:1212)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseObjectRestriction(ManchesterOWLSyntaxEditorParser.java:819)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseNonNaryClassExpression(ManchesterOWLSyntaxEditorParser.java:783)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseUnion(ManchesterOWLSyntaxEditorParser.java:688)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseIntersection(ManchesterOWLSyntaxEditorParser.java:663)
at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseClassExpression(ManchesterOWLSyntaxEditorParser.java:650)
at org.coode.owlapi.examples.DLQueryParser.parseClassExpression(DLQueryManager.java:413)
at org.coode.owlapi.examples.DLQueryEngine.getInstances(DLQueryManager.java:324)
at org.coode.owlapi.examples.DLQueryManager.getInstances(DLQueryManager.java:127)
任何想法如何解决这一问题?