我有一个本体,它将新数据类型定义为字符串类型的模式限制。然后将此数据类型用作属性范围限制。然后一个类被定义为对这个属性的限制:
@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" .
Protege 在使用 Pellet 推理器对该本体进行分类时崩溃:
UnsupportedOperationException: null
com.clarkparsia.pellet.datatypes.types.text.RestrictedTextDatatype.applyConstrainingFacet(RestrictedTextDatatype.java:93)
com.clarkparsia.pellet.datatypes.DatatypeReasonerImpl.getDataRange(DatatypeReasonerImpl.java:440)
FaCT++ 推理器因异常而失败:
ReasonerInternalException: Unsupported datatype 'http://test.com/prop#MyType'
uk.ac.manchester.cs.factplusplus.FaCTPlusPlus.getBuiltInDataType(Native Method)
Pellet 似乎只是将模式作为限制存在问题。FaCT++ 似乎对用户定义的数据类型有问题。
我是否在本体中有错误,或者推理器无法对这种模式限制进行分类?