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

Get MSDF from LinkML objects #440

Merged
merged 13 commits into from
Oct 5, 2023
Merged

Get MSDF from LinkML objects #440

merged 13 commits into from
Oct 5, 2023

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Oct 4, 2023

Closes #439

This PR adds three methods to the MappingSetDataFrame class that allow instantiation from LinkML objects such as MappingSetDocument, MappingSet, or a list of Mapping.

It has the benefit of pre-baking in logic for dealing with default metadata and converters, meaning that nobody has to roll this themselves downstream

This is going to help us address https://github.com/INCATools/ontology-access-kit/blob/75940bfa883001afb0e4aebb339fd62583c13844/src/oaklib/utilities/lexical/lexical_indexer.py#L313-L325, specifically in INCATools/ontology-access-kit#664

@cthoyt cthoyt changed the title Add entrypoints from LinkML Add entrypoints from LinkML objects Oct 4, 2023
@cthoyt cthoyt changed the title Add entrypoints from LinkML objects Get MSDF from LinkML objects Oct 4, 2023
cthoyt added a commit to cthoyt/ontology-access-kit that referenced this pull request Oct 4, 2023
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

I will have to rely on your own self-critical assessment of any risks involved here.. I checked it line by line, and it looks good to me, but I cannot mentally parse all of the details..

Are there any risks involved?

src/sssom/util.py Show resolved Hide resolved
src/sssom/util.py Outdated Show resolved Hide resolved
src/sssom/util.py Show resolved Hide resolved
@cthoyt
Copy link
Member Author

cthoyt commented Oct 4, 2023

@matentzn only risks is that there are more convoluted ways people will think of on how they want to provide metadata, besides that and some of the new python idioms, this is pretty straightforward.

@cthoyt
Copy link
Member Author

cthoyt commented Oct 4, 2023

@matentzn I added a round-trip test that demonstrates this works

@cthoyt cthoyt requested a review from matentzn October 4, 2023 15:01
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

Everything looks fine to me!

@cthoyt cthoyt merged commit 12c8b1a into master Oct 5, 2023
6 checks passed
@cthoyt cthoyt deleted the from-mappings branch October 5, 2023 08:23
hrshdhgd pushed a commit to INCATools/ontology-access-kit that referenced this pull request Dec 6, 2023
* Improve SSSOM-py usage

Relies on mapping-commons/sssom-py#440

* Update pyproject.toml

* Update sssom_utils.py

* Update sssom_utils.py

* Make code independent

* Fix typo

* Update lexical_indexer.py

* Update test_sssom_matcher.py

* Update test_sssom_matcher.py

* Update pyproject.toml

* Update lock

* Update lexical_indexer.py

* Update test_sssom_matcher.py

* Update pyproject.toml

* Lock

* Lock again

* Update reqs
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.

What to do when I have a list of Mapping objects?
2 participants