In my project, I read an ontology (owl file)for Cyber Domain with two Class
There are two ObjectProperties
hasVuln : Product → Vulnerability
affect : Vulnerability → Product
hasVuln owl:inverseOf affect
After I read base of vulnerabilities and create individuals with OwlReady2. In this examples, one product is affect by n vulnerabilities.
1- If the program create only, for example affect , hasVuln is not create
2- if the program create affect and hasVuln : hasVuln is not save
3- if I delete in the ontology the fact that « hasVuln owl:inverseOf affect » and
the program create affect and hasVuln → the result is correct
I don't understand the behavior of Owlready2
Inverse properties do not duplicate the data : if you assert "A hasVuln B", Owlready will not automatically assert "B affect A". This is usually considered as trivial, e.g. Protégé also does like this.
However, when you query "B.affect" in Owlready, it will list A because Owlready takes inverse properties into account when retrieving property values.