首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OWLAPI : HermiT推理器为导入的本体中的数据类型提供"UnsupportedDatatypeException“

OWLAPI : HermiT推理器为导入的本体中的数据类型提供"UnsupportedDatatypeException“
EN

Stack Overflow用户
提问于 2016-07-21 14:28:45
回答 1查看 429关注 0票数 3

我有两个本体论(通过蛋白酶生成)。

A本体(A.owl) :-

代码语言:javascript
复制
<?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) :-

代码语言:javascript
复制
<?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异常。

例外详情:-

代码语言:javascript
复制
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.

我的代码是:-

代码语言:javascript
复制
Configuration reasonerConf = new Configuration();
            reasonerConf.throwInconsistentOntologyException = false;
ReasonerFactory factory = new ReasonerFactory();
OWLReasoner reasoner = factory.createReasoner(owlOntology, reasonerConf); //Line where it throws above Exception

owlOntology是当前的工作本体,它是加载到owlManager (OWLOntologyManager)中的'A''Z'本体也在这个owlManager中。

我试着在抗议者中运行HermiT reasoner,但是它没有抛出任何例外。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-21 16:01:56

您声明了一个数据类型:

代码语言:javascript
复制
<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可以理解的定义,或者可能使用数据类型方面。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38506988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档