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 declareCountryhas a subclass ofowl:NamedIndividualbut so far I have not been able to do so... Is there a reason?
The triples stating
X rdf:type NamedIndividualhave 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:NamedIndividualis discarded because the OWLAPI doesn't understand it - it doesn't fit in the expected RDF to OWL mappings.