java - OWLAPI : HermiT reasoner thows "UnsupportedDatatypeException" for data type from imported Ontology -
i have 2 ontologies (generated through protege).
a ontology (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 owl api (version 3.5.1) http://owlapi.sourceforge.net -->
z ontology (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 owl api (version 3.5.1) http://owlapi.sourceforge.net -->
i have imported z.owl
inside a.owl
. when run hermit reasoner a ontology. throws , org.semanticweb.hermit.datatypes.unsupporteddatatypeexception
exception.
exception details :-
exception in thread "main" org.semanticweb.hermit.datatypes.unsupporteddatatypeexception: hermit supports , datatypes of owl 2 datatype map, see http://www.w3.org/tr/owl2-syntax/#datatype_maps. datatype 'http://www.semanticweb.org/ontologies/z#myname' not part of owl 2 datatype map , no custom datatype definition given; therefore, hermit cannot handle datatype.
my java code :-
configuration reasonerconf = new configuration(); reasonerconf.throwinconsistentontologyexception = false; reasonerfactory factory = new reasonerfactory(); owlreasoner reasoner = factory.createreasoner(owlontology, reasonerconf); //line throws above exception
owlontology
current working ontology 'a' loaded owlmanager
(owlontologymanager). 'z' ontology in owlmanager
.
i tried run hermit reasoner in protege doesn't throw exception there.
you declared datatype:
<rdfs:datatype rdf:about="http://www.semanticweb.org/ontologies/z#myname"/>
but has no associated definition. lexical form? "foo"^^ex:myname legal instance or not? equivalent value "foo"^^ex:myname or not? hermit doesn't have way know answer these questions, , complains:
the datatype 'http://www.semanticweb.org/ontologies/z#myname' not part of owl 2 datatype map , no custom datatype definition given; therefore, hermit cannot handle datatype.
you'll need provide kind of definition datatype hermit can understand, or perhaps use datatype facets instead.
Comments
Post a Comment