[英]GraphDB owl:equivalentClass infrencing not working. Protege reasoner is able to infer this
我使用 protege 创建了下面的本体并完全导入到 GraphDB 中。
我有 1 个个人“HxH”,类型为“漫画”,国家为“日本”。 我将“Manga”定义为 owl:equivalentClass to “comic + Japan”。
当我在 protege 中运行 reasoner 时,它能够推断出 HxH 是 Manga 类型。 GraphDB 不会推断出这一点。 它只在查询结果和图形概览选项卡中显示显式三元组。
图片来自 Protege: Protege 能够推断出 HxH 属于 Manga 类型(黄色高亮部分)
Sparql 查询(在 graphDB 中):
PREFIX : <http://www.comic.org/o-1#>
select * where {
:HxH?p ?o .
} limit 100
以上查询结果:
p | o | |
---|---|---|
1个 | RDF:类型 | :漫画 |
2个 | RDF:类型 | 猫头鹰:命名个人 |
3个 | : 有原产国 | :日本 |
GraphDB无法推断HxH 是 Manga 类型。
我创建的本体(Turtle 语法):
@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
所以,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.