fix: include elem_type in creation of notion with parent#4
Merged
felixocker merged 2 commits intofelixocker:mainfrom Dec 23, 2022
Merged
fix: include elem_type in creation of notion with parent#4felixocker merged 2 commits intofelixocker:mainfrom
felixocker merged 2 commits intofelixocker:mainfrom
Conversation
Contributor
Author
|
Oops, I just noticed that my suggested fix should probably only be applied to ObjectProperties and DataProperties and not classes to maintain a clean class hierarchy. I'll try to adapt my PR accordingly. |
Owner
|
thanks! |
felixocker
added a commit
that referenced
this pull request
Dec 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems reasonable to also include the
elem_typein the creation of new notions with parents.I came across this when using
add_instances(), as the use of a DataProperty created as a child of another DataProperty leads to erroneous behavior. Line 700 (if DataProperty in pred.is_a:) checks against theelem_type, which is currently only included for notions without parents. This seems to also apply to line 710. Predicates, that are created as children of other predicates, simply lack theDataPropertyorObjectPropertyparent, which is required to evaluate the conditions (l.700, l.710) to true.Here is a minimal example:
Adding the instance currently results in pred.is_a
[base.has_value, owl.FunctionalProperty]instead of the required[base.has_value, owl.DatatypeProperty, owl.FunctionalProperty].