igor.br
igor.br

Reputation: 29

Pellet reasoner crashes when classifying ontology with datatype restriction as pattern

I have an ontology that defines a new data type as pattern restriction on string type. This data type is then used as a property range restriction. Then a class is defined as a restriction on this property:

@prefix : <http://test.com/prop#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://test.com/prop> .

<http://test.com/prop> rdf:type owl:Ontology .

:MyType rdf:type rdfs:Datatype ;
        owl:equivalentClass [ rdf:type rdfs:Datatype ;
                              owl:onDatatype xsd:string ;
                              owl:withRestrictions ( [ xsd:pattern "[a-zA-Z]*"
                                                     ]
                                                   )
                            ] .


#    Properties

:hasProperty rdf:type owl:ObjectProperty .
:hasValue rdf:type owl:DatatypeProperty .


#    Classes

:BaseClass rdf:type owl:Class .
:BaseProperty rdf:type owl:Class .

:MyClass rdf:type owl:Class ;
         owl:equivalentClass [ rdf:type owl:Class ;
                               owl:intersectionOf ( :BaseClass
                                                    [ rdf:type owl:Restriction ;
                                                      owl:onProperty :hasProperty ;
                                                      owl:someValuesFrom :MyProperty
                                                    ]
                                                  )
                             ] ;
         rdfs:subClassOf :BaseClass .

:MyProperty rdf:type owl:Class ;
            owl:equivalentClass [ rdf:type owl:Class ;
                                  owl:intersectionOf ( :BaseProperty
                                                       [ rdf:type owl:Restriction ;
                                                         owl:onProperty :hasValue ;
                                                         owl:someValuesFrom :MyType
                                                       ]
                                                     )
                                ] ;
            rdfs:subClassOf :BaseProperty .


#    Individuals

:Ind1 rdf:type :BaseClass ,
               owl:NamedIndividual ;
      :hasProperty :Prop1 .

:Prop1 rdf:type :BaseProperty ,
                owl:NamedIndividual ;
       :hasValue "Maier" .

The Protege crashes while classifying this ontology with Pellet reasoner:

UnsupportedOperationException: null
    com.clarkparsia.pellet.datatypes.types.text.RestrictedTextDatatype.applyConstrainingFacet(RestrictedTextDatatype.java:93)
    com.clarkparsia.pellet.datatypes.DatatypeReasonerImpl.getDataRange(DatatypeReasonerImpl.java:440)

The FaCT++ reasoner failed with exception:

ReasonerInternalException: Unsupported datatype 'http://test.com/prop#MyType'
uk.ac.manchester.cs.factplusplus.FaCTPlusPlus.getBuiltInDataType(Native Method)

The Pellet seems only to have trouble with the pattern as a restriction. The FaCT++ seems to have trouble with a user defined datatype.

Do I have errors in the ontology or the reasoners are not able to classify such pattern restriction?

Upvotes: 0

Views: 445

Answers (1)

Dmitry Tsarkov
Dmitry Tsarkov

Reputation: 768

The current version of FaCT++ does not support user-defined datatypes. So the report from FaCT++ is correct.

Pellet should support user-defined datatypes, but your definition is incorrect. The owl:equivalentClass construction is a) from the obsolete OWL 1 syntax, that doesn't support datatype definitions, and b) is only valid for classes, not datatypes. I would suggest to use OWL 2 syntax http://www.w3.org/TR/2012/REC-owl2-syntax-20121211/ in your datatype definition.

Upvotes: 2

Related Questions