GraphDB猫头鹰:等效频道不起作用。 Protege Reasoner能够推断出来
我使用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
上述查询的结果:
P | O | |
---|---|---|
1 | RDF:类型 | :漫画 |
2 | RDF:类型 | 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 :
p | o | |
---|---|---|
1 | rdf:type | :Comic |
2 | rdf:type | owl: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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,
So,