我有两个本体论(通过蛋白酶生成)。
A本体(A.owl) :-
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.semanticweb.org/ontologies/A#"
xml:base="http://www.semanticweb.org/ontologies/A"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/ontologies/A">
<owl:imports rdf:resource="http://www.semanticweb.org/ontologies/Z"/>
</owl:Ontology>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/A#A -->
<owl:Class rdf:about="http://www.semanticweb.org/ontologies/A#A">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/ontologies/A#B"/>
</owl:Class>
<!-- http://www.semanticweb.org/ontologies/A#B -->
<owl:Class rdf:about="http://www.semanticweb.org/ontologies/A#B"/>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net -->Z本体(Z.owl) :-
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.semanticweb.org/ontologies/Z#"
xml:base="http://www.semanticweb.org/ontologies/Z"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/ontologies/Z"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Datatypes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/Z#myName -->
<rdfs:Datatype rdf:about="http://www.semanticweb.org/ontologies/Z#myName"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/Z#myProp -->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/ontologies/Z#myProp"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/Z#name -->
<owl:DatatypeProperty rdf:about="http://www.semanticweb.org/ontologies/Z#name">
<rdfs:range rdf:resource="http://www.semanticweb.org/ontologies/Z#myName"/>
</owl:DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/ontologies/Z#X -->
<owl:Class rdf:about="http://www.semanticweb.org/ontologies/Z#X">
<rdfs:subClassOf rdf:resource="http://www.semanticweb.org/ontologies/Z#Y"/>
</owl:Class>
<!-- http://www.semanticweb.org/ontologies/Z#Y -->
<owl:Class rdf:about="http://www.semanticweb.org/ontologies/Z#Y"/>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net -->我在A.owl中导入了A.owl。当我使用HermiT推理器运行A本体时。它引发和org.semanticweb.HermiT.datatypes.UnsupportedDatatypeException异常。
例外详情:-
Exception in thread "main" org.semanticweb.HermiT.datatypes.UnsupportedDatatypeException: HermiT supports all and only the datatypes of the OWL 2 datatype map, see
http://www.w3.org/TR/owl2-syntax/#Datatype_Maps.
The datatype 'http://www.semanticweb.org/ontologies/Z#myName' is not part of the OWL 2 datatype map and
no custom datatype definition is given;
therefore, HermiT cannot handle this datatype.我的代码是:-
Configuration reasonerConf = new Configuration();
reasonerConf.throwInconsistentOntologyException = false;
ReasonerFactory factory = new ReasonerFactory();
OWLReasoner reasoner = factory.createReasoner(owlOntology, reasonerConf); //Line where it throws above ExceptionowlOntology是当前的工作本体,它是加载到owlManager (OWLOntologyManager)中的'A'。'Z'本体也在这个owlManager中。
我试着在抗议者中运行HermiT reasoner,但是它没有抛出任何例外。
发布于 2016-07-21 16:01:56
您声明了一个数据类型:
<rdfs:Datatype rdf:about="http://www.semanticweb.org/ontologies/Z#myName"/>但它没有相关的定义。它的词汇形式是什么?“foo”^ex:myName是一个法律实例吗?它是否等同于“FOO”^ex:myName?HermiT没有办法知道这些问题的答案,因此抱怨:
数据类型'http://www.semanticweb.org/ontologies/Z#myName‘不是OWL 2数据类型映射的一部分,也没有给出自定义数据类型定义;因此,HermiT无法处理该数据类型。
您需要为这种数据类型提供某种HermiT可以理解的定义,或者可能使用数据类型方面。
https://stackoverflow.com/questions/38506988
复制相似问题