Skip to content
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

remove check if identifier is python identifier, add tests #273

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

sierra-moxon
Copy link
Member

@sierra-moxon sierra-moxon commented Aug 8, 2023

see linkml issue #1512
URI contraction for enum meaning is getting hung up on the local identifier of an NCIT CURIE matching the concept of a python identifier ending up in a mis-contraction of the URI which results in a failure like this:

>   ???
E   NameError: name 'NCIT_C25300' is not defined
test:184: NameError

quite possible that I do not understand the use case for a URI contraction to something like this: xyz.a123 or xyz.123 vs. xyz:123 or xyz:a123

@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2023

Codecov Report

Merging #273 (37e37e2) into main (74d699c) will increase coverage by 0.15%.
Report is 50 commits behind head on main.
The diff coverage is 72.22%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
+ Coverage   65.86%   66.01%   +0.15%     
==========================================
  Files          56       60       +4     
  Lines        7613     7701      +88     
  Branches     2012     2021       +9     
==========================================
+ Hits         5014     5084      +70     
- Misses       2009     2025      +16     
- Partials      590      592       +2     
Files Changed Coverage Δ
linkml_runtime/linkml_model/validation.py 0.00% <0.00%> (ø)
linkml_runtime/utils/context_utils.py 73.33% <ø> (+5.00%) ⬆️
linkml_runtime/utils/namespaces.py 72.51% <43.75%> (-0.86%) ⬇️
linkml_runtime/loaders/loader_root.py 69.84% <54.28%> (+3.17%) ⬆️
linkml_runtime/dumpers/rdf_dumper.py 65.90% <55.55%> (-5.89%) ⬇️
linkml_runtime/loaders/delimited_file_loader.py 82.85% <82.85%> (ø)
linkml_runtime/dumpers/json_dumper.py 77.77% <84.61%> (-1.54%) ⬇️
linkml_runtime/loaders/yaml_loader.py 92.30% <85.71%> (+1.00%) ⬆️
linkml_runtime/utils/schemaview.py 87.79% <88.88%> (ø)
linkml_runtime/dumpers/delimited_file_dumper.py 89.65% <89.65%> (ø)
... and 13 more

uri_string = str(uri)

# Find the longest match for the URI, self.items() is a list of (prefix/namespace, uri base prefix) tuples
for namespace, uri_base in self.items():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the curies package be used here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do need to look at all our different namespace/namespaces modules and reconcile! I appreciate the note here.

@sierra-moxon sierra-moxon merged commit 2fc42c0 into main Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants