Owlready2 accessing attributes of powertypes - How to access the attributes of an instance that is a sub-class too
This post was updated on .
André Muniz Demori <email@example.com> Anexos
18:25 (há 2 minutos)
Hello, my name is André Demori and I'm from the Military Institute of Engineering of Brazil.
I have a question about Owlready2 that I can't resolve. I'm working on my ontology with the concept of powertype, that is, I have a subclass, for example 'Platoon' and I use the same IRI of this subclass as an instance of another class called 'MilitaryOrganizationpowerType'. So Platoon is a subclass of MilitaryOrganization and instance of MilitaryOrganizationpowerType.
However, I cannot access the data properties of this instance, for example:
platoon_ms = ref_onto.Platoon.maxStrength
I can't access Platoon.maxStrength, as it is recognized by owlready2 as a subclass and not as an instance.
Do you know if this is something missing from OWLReady2? If so, here is a suggestion for future updates, it is, include a way to access the attributes of an instance that is a sub-class too.
Attached are some prints to better explain the idea.
Re: Owlready2 accessing attributes of powertypes - How to access the attributes of an instance that is a sub-class too
TLDR: Make sure that the class and the instance do not have the same IRI.
By definition, the set of classes and the set of individuals in an ontology are disjoint.
There are probably even more basic references, but the one I can think of spontaneously is Euzenat and Shvaiko , who provide a neat formal definition of an ontology:
o = 〈C, I, R, T, V, v, ⊥, ∈, =〉
o = ontology
C = set of universals
I = set of individuals
R = set of relations
T = set of data types
V = set of values
v = specialization relation on (C × C) ∪ (R × R) ∪ (T × T )
⊥ = exclusion relation on (C × C) ∪ (R × R) ∪ (T × T )
∈ = instantiation relation over (I × C) ∪ (V × T )
= = assignment relation over I × R × (I ∪ V )
C, I, R, T, and V are pairwise disjoint
Thus, "Platoon" being both a class and an individual is simply not valid (in OWL2DL).
One idea that might help you resolve this is something akin to a singleton  - you could create a class "Platoon", which has only a single instance, e.g., "platoon". Naming preferences vary, but personally I tend towards the one suggested by Arp and Smith : "Along the same lines as principle 5, we recommend that when preparing ontology content for review by human beings lowercase italic letters be used for terms referring to universals or classes (this recommendation being based in part on the fact that initial capital letters are normally used in English to indicate proper names, which are names
of instances (“Tom,” “Seattle,” “Jupiter”). Thus cat, not “Cat” or “CAT,” [...]"
Not entirely sure though if that is the same thing as what you mean by Powertype.