Search code examples
rdfowlprotegegraphdb

graphDB consistency check not working while protege is showing expected results


My Ontology is simple (made in Protege). I've made

  • Manga and Manhwa classes disjoint to each other.
  • Any individual that is Comic + Japan is a Manga.
  • Any individual that is Comic + South Korea is a Manhwa.

Now I created an individual "SL" that belongs to class Manhwa and hasCountry Japan. This combination should not be possible. Protege reasoner (HermiT) will throw error for this. (expected behaviour)

But when I import this into GraphDb, it doesn't show any error. On the contrary GraphDB will tell that "SL" belongs to both Manga and Manhwa classes and hasCountry both Japan and South Korea. I've enabled consistency checks and SHACL validation when creating this repository and am using OWL-max ruleset.

What else should I do to turn on consistency check in GraphDB that will give error?

@prefix : <http://comi.test/#> .
@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://comi.test/#> .

<http://comi.test/#> rdf:type owl:Ontology .

#################################################################
#    Object Properties
#################################################################

###  http://comi.test/#hasCountry
:hasCountry rdf:type owl:ObjectProperty ,
                     owl:FunctionalProperty ;
            rdfs:domain :Comic ;
            rdfs:range :Country .


#################################################################
#    Classes
#################################################################

###  http://comi.test/#Comic
:Comic rdf:type owl:Class .


###  http://comi.test/#Country
:Country rdf:type owl:Class .


###  http://comi.test/#Manga
:Manga rdf:type owl:Class ;
       owl:equivalentClass [ owl:intersectionOf ( :Comic
                                                  [ rdf:type owl:Restriction ;
                                                    owl:onProperty :hasCountry ;
                                                    owl:hasValue :Japan
                                                  ]
                                                ) ;
                             rdf:type owl:Class
                           ] ;
       rdfs:subClassOf :Comic ;
       owl:disjointWith :Manhwa .


###  http://comi.test/#Manhwa
:Manhwa rdf:type owl:Class ;
        owl:equivalentClass [ owl:intersectionOf ( :Comic
                                                   [ rdf:type owl:Restriction ;
                                                     owl:onProperty :hasCountry ;
                                                     owl:hasValue :South_Korea
                                                   ]
                                                 ) ;
                              rdf:type owl:Class
                            ] ;
        rdfs:subClassOf :Comic .


#################################################################
#    Individuals
#################################################################

###  http://comi.test/#Japan
:Japan rdf:type owl:NamedIndividual ,
                :Country .


###  http://comi.test/#SL
:SL rdf:type owl:NamedIndividual ,
             :Manhwa ;
    :hasCountry :Japan .


###  http://comi.test/#South_Korea
:South_Korea rdf:type owl:NamedIndividual ,
                      :Country .


###  http://comi.test/#hxh
:hxh rdf:type owl:NamedIndividual ,
              :Comic ;
     :hasCountry :Japan .


###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi

Solution

  • Use owl2rl ruleset in graphDB, as other rulesets don't have consistency checking built into them.