Protegé Wh7 是否为每个具有 IRI 的实例添加 owl:NamedIndividual 作为 rdf:type?

问题描述 投票:0回答:2

我正在努力理解

owl:NamedIndividual
的兴趣(https://www.w3.org/2007/OWL/wiki/FullSemanticsNamedIndividuals

如果我在 Protegé 中打开以下文件,并将其保存回 .ttl 文件

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix countrybase: <http://www.dummy.com/soquestion/2023/countries#> .

countrybase:countryName rdf:type owl:DatatypeProperty ,
                                        owl:FunctionalProperty ;
                               rdfs:domain countrybase:Country ;
                               rdfs:range xsd:string ;
                               rdfs:label "CountryName"@en .


countrybase:Country rdf:type owl:Class ;
                           owl:equivalentClass [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                                                        owl:onProperty countrybase:countryName ;
                                                                        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
                                                                        owl:onDataRange xsd:string
                                                                      ]
                                                                    ) ;
                                                 rdf:type owl:Class
                                               ] ;
                           owl:hasKey ( countrybase:countryName ) ;
                           .


countrybase:Country-Germany rdf:type owl:NamedIndividual ,
                                  countrybase:Country ;
                                  countrybase:countryName "Germany" ;
                                  .

countrybase:Country-Greece rdf:type 
                                  countrybase:Country ;
                                  countrybase:countryName "Greece" ;
                                  .

_:B1657117687b18459b00 rdf:type 
                                  countrybase:Country ;
                                  countrybase:countryName "Hungary" ;
                                  .

_:B1657117687b18459b99 rdf:type owl:NamedIndividual ,
                                  countrybase:Country ;
                                  countrybase:countryName "Iceland" ;
                                  .

我得到了

@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#> .
@prefix countrybase: <http://www.dummy.com/soquestion/2023/countries#> .
@base <http://www.w3.org/2002/07/owl#> .

[ rdf:type owl:Ontology
 ] .

#################################################################
#    Data properties
#################################################################

###  http://www.dummy.com/soquestion/2023/countries#countryName
countrybase:countryName rdf:type owl:DatatypeProperty ,
                                 owl:FunctionalProperty ;
                        rdfs:domain countrybase:Country ;
                        rdfs:range xsd:string ;
                        rdfs:label "CountryName"@en .


#################################################################
#    Classes
#################################################################

###  http://www.dummy.com/soquestion/2023/countries#Country
countrybase:Country rdf:type owl:Class ;
                    owl:equivalentClass [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                                                 owl:onProperty countrybase:countryName ;
                                                                 owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
                                                                 owl:onDataRange xsd:string
                                                               ]
                                                             ) ;
                                          rdf:type owl:Class
                                        ] ;
                    owl:hasKey ( countrybase:countryName
                               ) .


#################################################################
#    Individuals
#################################################################

###  http://www.dummy.com/soquestion/2023/countries#Country-Germany
countrybase:Country-Germany rdf:type owl:NamedIndividual ,
                                     countrybase:Country ;
                            countrybase:countryName "Germany" .


###  http://www.dummy.com/soquestion/2023/countries#Country-Greece
countrybase:Country-Greece rdf:type owl:NamedIndividual ,
                                    countrybase:Country ;
                           countrybase:countryName "Greece" .


[ rdf:type countrybase:Country ;
  countrybase:countryName "Hungary"
] .

[ rdf:type countrybase:Country ;
   countrybase:countryName "Iceland"
 ] .

###  Generated by the OWL API (version 4.5.25.2023-02-15T19:15:49Z) https://github.com/owlcs/owlapi

owl:NamedIndividual
已从空白节点中删除并添加到具有 IRI 的个体中。

我的问题:

  • 添加类型来表明某物具有 IRI 的目的是什么?
  • 有没有办法指定某个东西应该在类(即
    Country
    )级别有一个IRI?我希望声明
    Country
    owl:NamedIndividual
    的子类,但到目前为止我还无法这样做......有什么原因吗?
rdf owl protege turtle-rdf
2个回答
2
投票

表示

X rdf:type NamedIndividual
的三元组尚未移动。根据定义,由空白节点表示的个体不是命名个体 - 事实相反,即任何命名个体都有 IRI 并且不由空白节点表示。

您在这里看到的是 Protege 明确表示指定个体被声明为命名个体(声明是可选的,因此旧文件和新文件都是正确的)。 您的三元组

_:B1657117687b18459b99 rdf:type owl:NamedIndividual
被丢弃,因为 OWLAPI 无法理解它 - 它不符合预期的 RDF 到 OWL 映射。


2
投票

owl:NamedIndividual
用作 声明。因此,它不会影响推理,仅用于检查特定实体是否按照其声明方式使用。当您使用基于 RDF 的语义时,这并不重要(在 OWL 2 Full 中,它与
owl:Thing
是同一类),但 OWL 2 DL 区分命名(使用 IRI)和匿名(使用 bNode)个体,其中一些个人资料甚至完全禁止匿名个人。

Protegé 这里尽最大努力确保本体在各种较低配置文件中是可接受的,通过根据识别方式标记声明,但如果您执行类似

_:bnode a owl:NamedIndividual .
的操作,严格来说并不是一个错误 - 您可以使用它来表达它确实是一个具有(未知)IRI 的适当个体,而不是 RDFS 使用的存在量词式概念。

© www.soinside.com 2019 - 2024. All rights reserved.