问题
I am defining a property with integer range as
:hasIndex rdf:type owl:DatatypeProperty ;
rdfs:range xsd:integer .
My understanding is that it should only accept integers as object, anything else should be considered as inconsistent and throw errors. However, when I create instances with strings as objects in GraphDb as the following, both entries are successfully loaded into the database (as "asd"^^xsd:string) without any errors:
:nodea :hasIndex "asd" .
:nodeb :hasIndex "asd"^^xsd:string .
回答1:
The OWL specification does not require that any attempt to load an inconsistent ontology or knowledge base triggers an error. In fact, it would be practically foolish, since checking consistency in OWL 2 DL (for instance) is a N2EXPTIME complete problem. So all practical semantic web data management system load whatever syntactically valid data and only attempt consistency checking on demand.
Moreover, you are using GraphDb. It does not implement all of OWL, and it works according to an OWL dialect partially covering the OWL 2 RDF-based semantics. The compliance with OWL in GraphDB is described on a dedicated web page. The page says that:
GraphDB does not provide the extended support for typed literals (...)
There are no inconsistency rules by default
来源:https://stackoverflow.com/questions/48155441/conflicts-with-using-xsdinteger-as-rdfsrange