添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

GraphDB owl:equivalentClass infrencing not working. Protege reasoner is able to infer this

Ask Question

I created below ontology using protege and imported exactly into GraphDB.

I've 1 individual "HxH" which is of type "comic" and has country "Japan". I've defined "Manga" as owl:equivalentClass to "comic + Japan".

When I run reasoner in protege it is able to infer that HxH is of type Manga . GraphDB doesn't infer this. It only display explicit triples both in query result and graph overview tab.

Image from Protege : Protege is able to infer that HxH is of type Manga (yellow highlights)

Sparql query (in graphDB) :

PREFIX : <http://www.comic.org/o-1#>
select * where { 
    :HxH?p ?o .
} limit 100 

Result of above query :

GraphDB couldn't infer HxH is of type Manga.

Ontology I created (Turtle syntax) :

@prefix : <http://www.comic.org/o-1#> .
@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://www.comic.org/o-1> .
<http://www.comic.org/o-1> rdf:type owl:Ontology .
#################################################################
#    Object Properties
#################################################################
###  http://www.comic.org/o-1#hasCountryOfOrigin
:hasCountryOfOrigin rdf:type owl:ObjectProperty ,
                             owl:FunctionalProperty ;
                    rdfs:domain :Comic ;
                    rdfs:range :Country .
#################################################################
#    Classes
#################################################################
###  http://www.comic.org/o-1#Comic
:Comic rdf:type owl:Class ;
       owl:disjointWith :Country .
###  http://www.comic.org/o-1#Country
:Country rdf:type owl:Class .
###  http://www.comic.org/o-1#Manga
:Manga rdf:type owl:Class ;
       owl:equivalentClass [ owl:intersectionOf ( :Comic
                                                  [ rdf:type owl:Restriction ;
                                                    owl:onProperty :hasCountryOfOrigin ;
                                                    owl:hasValue :Japan
                             rdf:type owl:Class
#################################################################
#    Individuals
#################################################################
###  http://www.comic.org/o-1#HxH
:HxH rdf:type owl:NamedIndividual ,
              :Comic ;
     :hasCountryOfOrigin :Japan .
###  http://www.comic.org/o-1#Japan
:Japan rdf:type owl:NamedIndividual ,
                :Country .
###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
                Protege does make use of full OWL DL reasoners like Pellet or HermiT. GraphDB doesn't have such a reasoner - which ruleset did you use? I mean, it has to cover equivalence, intersection in superclass and hasValue constraints.
– UninformedUser
                Jun 8, 2022 at 6:03
                @UninformedUser I used RDFS-Plus(optimized) rule set. Reading from here RDFS-Plus does cover equivalence. Not sure about other two.   I'll try runing new database with different rule set and edit this commet if it works.
– Phobia7743
                Jun 8, 2022 at 13:56
                Edit : Ruleset - OWL-Max is working. Wrong ruleset was the problem. Thank you for your help.
– Phobia7743
                Jun 8, 2022 at 14:03
  • the problem was when we create a new DB instance in GraphDB it set "Ruleset = RDF-Plus" by default.
  • Changing this to "OWL-Max" or any other rule set that support equivalence, intersection and hasValue should do the job.
  • Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.