0

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?

igor.br
  • 29
  • 7

1 Answers1

2

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.

Dmitry Tsarkov
  • 768
  • 4
  • 11
  • I've created the ontolgy with Protege. As well the datatype :MyType is also created with Protege on the pane Datatypes of the category Entities. What is in your opinion the right way to define the datatype :MyType? Thanks – igor.br Oct 09 '15 at 19:12
  • Hi! It might be the case that you are using very old version of Protege. I would try this with the most recent one (Protege 5.0b or Protege 4.3) – Dmitry Tsarkov Nov 02 '15 at 11:03