I'm trying to import data to GraphDB, but have a problem (or more likely: a misunderstanding) regarding consistency validation on functional properties:
I am using a repository with OWL2-RL ruleset and consistency checks enabled, and imported the following ontology, which provides a class for Building
s and Elevator
s, as well as the property hasElevator
to link elevators to their building. Furthermore, it includes a functional boolean property containsAnyElevators
, which is automatically inferred to be true
as soon as a building has any elevator:
# Ontology
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix onto: <https://example.data/ontology#> .
@prefix data: <https://example.data/data#> .
onto:Building a rdfs:Class .
onto:Elevator a rdfs:Class .
onto:hasElevator a owl:ObjectProperty ;
rdfs:domain onto:Building ;
rdfs:range onto:Elevator .
onto:containsAnyElevators a owl:DatatypeProperty ;
a owl:FunctionalProperty ;
rdfs:domain onto:Building ;
rdfs:range xsd:boolean .
_:buildingHasElevator a owl:Restriction ;
owl:onProperty onto:hasElevator ;
owl:someValuesFrom onto:Elevator .
_:buildingContainsAnyElevatorsTrue a owl:Restriction ;
owl:onProperty onto:containsAnyElevators ;
owl:hasValue "true"^^xsd:boolean .
_:buildingHasElevator owl:equivalentClass _:buildingContainsAnyElevatorsTrue .
Now, given the following data:
# Data
@prefix onto: <https://example.data/ontology#> .
@prefix data: <https://example.data/data#> .
data:ElevatorA a onto:Elevator .
data:BuildingA a onto:Building ;
onto:hasElevator data:ElevatorA .
data:BuildingB a onto:Building.
GraphDB correctly infers onto:containsAnyElevators = true
for ElevatorA
. If I now however import another dataset which is inconsistent with that fact
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix onto: <https://example.data/ontology#> .
@prefix data: <https://example.data/data#> .
data:BuildingA onto:containsAnyElevators "false"^^xsd:boolean .
GraphDB doesn't complain, and will show onto:containsAnyElevators = false
as well as onto:containsAnyElevators = true
when describing ElevatorA
, which shouldn't be possible, given that containsAnyElevators
is a functional property.
I'm pretty sure I'm either misunderstanding the purpose/scope of consistency checks or that I'm overlooking something else, but I'd be really thankful if anyone could help and explain why GraphDB is not complaining here.
Thanks in advance (:
Edit: I'm using GraphDB 9.10.1