生成的rdf文件:
<?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#" >
<!ENTITY untitled-ontology-28 "http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#" >
]>
<rdf:RDF xmlns="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#"
xml:base="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28"
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#"
xmlns:untitled-ontology-28="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#">
<owl:Ontology rdf:about="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#hasPattern -->
<owl:DatatypeProperty rdf:about="&untitled-ontology-28;hasPattern">
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#hasString -->
<owl:DatatypeProperty rdf:about="&untitled-ontology-28;hasString">
<rdfs:range rdf:resource="&xsd;string"/>
</owl:DatatypeProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#PatternTestClass -->
<owl:Class rdf:about="&untitled-ontology-28;PatternTestClass">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&untitled-ontology-28;hasString"/>
<owl:someValuesFrom>
<rdfs:Datatype>
<owl:onDatatype rdf:resource="&xsd;string"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:length rdf:datatype="&xsd;string">8</xsd:length>
</rdf:Description>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:someValuesFrom>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&untitled-ontology-28;hasPattern"/>
<owl:someValuesFrom>
<rdfs:Datatype>
<owl:onDatatype rdf:resource="&xsd;string"/>
<owl:withRestrictions rdf:parseType="Collection">
<rdf:Description>
<xsd:pattern>[ABC]</xsd:pattern>
</rdf:Description>
</owl:withRestrictions>
</rdfs:Datatype>
</owl:someValuesFrom>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#PatternA -->
<owl:NamedIndividual rdf:about="&untitled-ontology-28;PatternA">
<rdf:type rdf:resource="&untitled-ontology-28;PatternTestClass"/>
<hasString rdf:datatype="&xsd;string">qwerasd</hasString>
<hasPattern rdf:datatype="&xsd;string">zzzzz</hasPattern>
</owl:NamedIndividual>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net -->
好吧,我检查了字符串模式,[ABC]
表示字母A
或B
或C
。但是NamedIndividual PatternA
有字符串zzzzz
,它不符合[ABC]
。
看起来HermiT不支持推理整数:
org.semanticweb.HermiT.datatypes.UnsupportedFacetException: The datatype rdf:PlainLiteral accepts only integers as facet values for the facet with URI 'http://www.w3.org/2001/XMLSchema#length', but in the ontology we have a datatype restriction org.semanticweb.HermiT.datatypes.rdfplainliteral.RDFPlainLiteralDatatypeHandler@685f8461. The value '"8"^^xsd:string' does not seem to be an integer.
问题已更新:推理已更改。并添加了新属性
现在我收到了错误:
FaCT++.Kernel: Reasoner for the SROIQ(D) Description Logic, 64-bit
Copyright (C) Dmitry Tsarkov, 2002-2015. Version 1.6.4-SNAPSHOT (10 April 2015)
Error logged
org.semanticweb.owlapi.reasoner.ReasonerInternalException: FaCT++ Kernel: unsupported facet 'getLength'
at uk.ac.manchester.cs.factplusplus.FaCTPlusPlus.getLength(Native Method)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$DataRangeTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$DataRangeTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.owl.owlapi.OWLDatatypeRestrictionImpl.accept(OWLDatatypeRestrictionImpl.java:154)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.toDataTypeExpressionPointer(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$ClassExpressionTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$ClassExpressionTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.owl.owlapi.OWLDataSomeValuesFromImpl.accept(OWLDataSomeValuesFromImpl.java:105)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.toClassPointer(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$AxiomTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$AxiomTranslator.visit(Unknown Source)
at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:168)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.loadAxiom(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.loadReasonerAxioms(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.<init>(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory.createReasoner(Unknown Source)
at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory.createReasoner(Unknown Source)
at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:21)
at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:434)
at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:390)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:1)
FaCT ++的例外说不支持你正在使用的方面 - 这是FaCT ++实现的限制。
关于HermiT,你得到的错误是由于:
<xsd:length rdf:datatype="&xsd;string">8</xsd:length>
数据类型需要是int(或整数),而不是字符串。