-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wip] fixing context generator for any_of
with range
#1898
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1898 +/- ##
=======================================
Coverage 80.13% 80.13%
=======================================
Files 100 100
Lines 11476 11504 +28
Branches 2956 2904 -52
=======================================
+ Hits 9196 9219 +23
+ Misses 1734 1732 -2
- Partials 546 553 +7 ☔ View full report in Codecov by Sentry. |
@@ -150,7 +150,8 @@ def visit_slot(self, aliased_slot_name: str, slot: SlotDefinition) -> None: | |||
else: | |||
slot_def = {} | |||
if not slot.usage_slot_name: | |||
if slot.range in self.schema.classes: | |||
any_of_ranges = [any_of_el["range"] for any_of_el in slot.any_of] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this definitely work? All metamodel elements should be accessed as objects, e.g any_of_el.range
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it worked, but I will change it to any_of_el.range
As a next step for this PR, I recommend taking a look at: linkml/tests/test_compliance/test_boolean_slot_compliance.py Lines 54 to 116 in b6c62ba
and adding something here: linkml/tests/test_compliance/test_boolean_slot_compliance.py Lines 100 to 102 in b6c62ba
to test the jsonld context output But let us know if you have issues or don't have time for that and we can take on the PR, thanks! |
I've added a check for FYI: I must say that it was a bit confusing to me when pytest was failing only for one combination of |
@cmungall - I've been using this branch for one of my project, and I have problems when I have
In this specific case, If in the context I have Not sure if this is a common case to have range either string or class, and if there is a way that this PR should be changed? |
fixies #1897
I've tried to fix the context generator, but I'm actually not sure if my approach is correct. Should
slot_def["@type"] = "@id"
be added if any of the ranges fromany_of
are inself.schema.classes
?