Why does Protégé add owl:NamedIndividual as rdf:type for each instance that has an IRI?

129 Views Asked by At

I am struggling to understand the interest of owl:NamedIndividual (https://www.w3.org/2007/OWL/wiki/FullSemanticsNamedIndividuals)

If I open the following file into Protegé, and save it back to a .ttl file

@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" ;
                                  .

I obtain

@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 has been removed from the blank nodes and added to the individual that have an IRI.

My questions:

  • what the purpose of adding a type to say that something has an IRI?
  • is there a way to specify that something should have an IRI at the class (i.e. Country) level? I was hoping to declare Country has a subclass of owl:NamedIndividual but so far I have not been able to do so... Is there a reason?
2

There are 2 best solutions below

2
Ignazio On

The triples stating X rdf:type NamedIndividual have not been moved. Individuals represented by blank nodes are not, by definition, named individuals - the opposite is true, i.e., any named individual has an IRI and is not represented by a blank node.

What you see here is Protege making it explicit that the named individuals are declared as named individuals (the declaration is optional, so both the old file and the new file are correct). Your triple _:B1657117687b18459b99 rdf:type owl:NamedIndividual is discarded because the OWLAPI doesn't understand it - it doesn't fit in the expected RDF to OWL mappings.

0
IS4 On

owl:NamedIndividual is used as a declaration. As such, it does not affect reasoning and serves only to check that a particular entity is used in accordance with how it was declared. This is not important much when you use the RDF-based semantics (and in OWL 2 Full, it is the same class as owl:Thing), but OWL 2 DL distinguishes between named (using IRI) and anonymous (using bNode) individuals, and some profiles of it even disallow anonymous individuals completely.

Protegé here does its best to ensure that the ontology is acceptable in the various lower profiles, by marking declarations based on the way they are identified, but it is not strictly an error if you do something like _:bnode a owl:NamedIndividual . ‒ you may use that to convey that it really is a proper individual that has an (unknown) IRI, as opposed to an existential quantifier-like notion used by RDFS.