GraphDB一致性检查在Protege显示预期结果时无法工作

发布于 2025-02-06 17:32:58 字数 3510 浏览 2 评论 0原文

我的本体学很简单(制成蛋白质)。我已经制作了

  • 漫画 manhwa 类彼此不相交。
  • 任何 Comic + Japan 的个人都是A 漫画
  • 任何漫画 +韩国的个人都是 manhwa

现在,我创建了一个属于 manhwa 和hascountry 日本的个人“ sl ”。这种组合是不可能的。 Protege推理器(隐士)将为此丢弃错误。(预期行为)

,但是当我将其导入GraphDB时,它不会显示任何错误。相反,GraphDB将会告诉 “ sl” 均属于漫画 manhwa 类别,而HASCOUNTRITY均 Japan 和韩国。在创建此存储库并使用OWL-MAX规则集时,我启用了一致性检查和SHACL验证。

我还应采取什么措施打开GraphDB中的一致性检查?

@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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2025-02-13 17:32:58

在GraphDB中使用OWL2RLL规则集,因为其他规则集没有内置的一致性检查。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文