当前位置: 首页 > 知识库问答 >
问题:

OWLAPI: HermiT推理器为来自导入本体的数据类型提供“不支持的数据类型例外”

丰誉
2023-03-14

我有2个本体论(通过蛋白质生成)。

本体(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 -->

本体论

<?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 -->

我已经导入了Z. owl里面的A. owl。当我用本体论运行赫敏推理器时。它抛出和org.semanticweb.HermiT. datatypes。[代码]异常。

例外情况详情:-

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.

我的JAVA代码是:-

Configuration reasonerConf = new Configuration();
            reasonerConf.throwInconsistentOntologyException = false;
ReasonerFactory factory = new ReasonerFactory();
OWLReasoner reasoner = factory.createReasoner(owlOntology, reasonerConf); //Line where it throws above Exception

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

我试图在门徒中运行赫敏推理器,但它没有引发任何异常。


共有1个答案

公西繁
2023-03-14

声明了一个数据类型:

<rdfs:Datatype rdf:about="http://www.semanticweb.org/ontologies/Z#myName"/>

但它没有相关的定义。它的词汇形式是什么?“foo”^^ex:myName是否为法律实例?它是否等同于“FOO”^^ex:myName的值?隐士没有办法知道这些问题的答案,因此抱怨:

数据类型'http://www.semanticweb.org/ontologies/Z#myName'不是OWL 2数据类型映射的一部分,并且没有给出自定义数据类型定义;因此,HermiT无法处理此数据类型。

您需要为这种数据类型提供某种HermiT可以理解的定义,或者使用数据类型方面来代替。

 类似资料:
  • 谷歌云SQL提供的所有数据类型是什么? 我正在迁移一个数据库,所以我想知道谷歌云支持的数据类型。如果有任何官方链接,请提供。

  • pg 相对于其它关系型数据库的一大优势就在于成熟的复杂类型支持,包括数组、JSON 对象、HStore 等等。 Array pg 的数组功能非常强大,支持类型数组、多维数组、定长数组。 定义一个简单的数组列: CREATE TABLE sample_table ( array_example integer[], ); 对应插入语句: INSERT INTO sample_table

  • 着色器语言GLSL的基本数据类型和C语言一样具有常见的整型数int、浮点数float和布尔值bool类型数据。 关键字 数据类型 值 bool 布尔值 布尔变量值为true或false int 整型数 值为整数,比如0,1,2,3... float 单精度浮点数 浮点数用小数点表示,比如0.6,3.14,2.8 // bool关键字声明一个数据类型是布尔值的变量,并赋值为true bool lig

  • 字符串 hash list set zset

  • 我正在尝试运行Protege推理机,有两个推理机可用Fact和HermiT 1.3.7。 我找不到任何错误消息或日志消息。 推理器没有启动。 我尝试使用Export推断公理选项作为本体,然后得到预期的错误消息“No Reasonizer Initialized” 请建议。 编辑1: 由于定义了新的数据类型而导致的错误日志: 正在使用的本体: http://pastebin.com/L0heDLBy

  • 它总是给出415不支持的媒体类型错误从邮递员。Header包含带有边界的多部分/表单数据,如下所示CURL调用中所示。还尝试用RequestBody替换RequestPart但没有成功。 当使用FilePart时,我们是否需要以不同的方式调用Spring5中的多部分文件上传API? 然而,将uploads参数从更改为是有效的。 我们不能对RequestPart使用相同的curl调用吗?