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

Convert SSSOM TSV => JSON => TSV and confirm the MappingSetDataFrame object remains consistent. #429

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/sssom/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ def clean_prefix_map(self, strict: bool = True) -> None:
if self.metadata:
prefixes_in_table.update(get_prefixes_used_in_metadata(self.metadata))

missing_prefixes = prefixes_in_table - self.converter.get_prefixes()
# Convert prefixes_in_table to lowercase
prefixes_in_table_lower = {prefix.lower() for prefix in prefixes_in_table}
# Convert self.converter.get_prefixes() to lowercase
converter_prefixes_lower = {prefix.lower() for prefix in self.converter.get_prefixes()}
missing_prefixes = prefixes_in_table_lower - converter_prefixes_lower
# missing_prefixes = prefixes_in_table - self.converter.get_prefixes()

if missing_prefixes and strict:
raise ValueError(
f"{missing_prefixes} are used in the SSSOM mapping set but it does not exist in the prefix map"
Expand Down
8 changes: 8 additions & 0 deletions tests/data/sample1.sssom.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#curie_map:
# FBbt: "http://purl.obolibrary.org/obo/FBbt_"
# ORCID: "https://orcid.org/"
# UBERON: "http://purl.obolibrary.org/obo/UBERON_"
#creator_id:
# - "ORCID:0000-0002-6095-8718"
subject_id subject_label predicate_id object_id mapping_justification
FBbt:00000001 organism semapv:crossSpeciesExactMatch UBERON:0000468 semapv:ManualMappingCuration
Loading