我正在努力理解
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 的个体中。
我的问题:
Country
)级别有一个IRI?我希望声明 Country
有 owl:NamedIndividual
的子类,但到目前为止我还无法这样做......有什么原因吗?表示
X rdf:type NamedIndividual
的三元组尚未移动。根据定义,由空白节点表示的个体不是命名个体 - 事实相反,即任何命名个体都有 IRI 并且不由空白节点表示。
您在这里看到的是 Protege 明确表示指定个体被声明为命名个体(声明是可选的,因此旧文件和新文件都是正确的)。 您的三元组
_:B1657117687b18459b99 rdf:type owl:NamedIndividual
被丢弃,因为 OWLAPI 无法理解它 - 它不符合预期的 RDF 到 OWL 映射。