GraphDB猫头鹰:等效频道不起作用。 Protege Reasoner能够推断出来

发布于 2025-02-05 07:11:59 字数 3112 浏览 4 评论 0原文

我使用Protege创建了下面的本体,并精确地导入GraphDB。

我有1个单独的“ HXH”,它是“漫画”类型的“日本”。我将“漫画”定义为猫头鹰:等效频道为“漫画 +日本”。

当我在Protege中运行推理时,可以推断出HXH是漫画型。 GraphDB不推断。它仅在查询结果和图形概述选项卡中显示显式三元。

来自Protege的图像: protege能够推断出HXH hxh是漫画类型(黄色亮点)

sparql查询(在GraphDB中):

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

上述查询的结果:

PO
1RDF:类型:漫画
2RDF:类型OWL:名为非凡的
3:Hascountryoforigin:Japan

GraphDB 无法推断 HXH是漫画类型。

我创建的本体论(乌龟语法):

@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

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 :

po
1rdf:type:Comic
2rdf:typeowl:NamedIndividual
3:hasCountryOfOrigin:Japan

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

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

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

发布评论

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

评论(1

断桥再见 2025-02-12 07:11:59

因此,

  • 问题在于,当我们在GraphDB中创建一个新的DB实例时,默认情况下设置了“ RuleSet = RDF-Plus”。
  • 将其更改为“ OWL-MAX”或任何其他支持等效性,相交和HASVALUE的其他规则集应完成工作。

So,

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