diff --git a/src/sssom/util.py b/src/sssom/util.py index fc7249b0..9491d0a1 100644 --- a/src/sssom/util.py +++ b/src/sssom/util.py @@ -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" diff --git a/tests/data/sample1.sssom.tsv b/tests/data/sample1.sssom.tsv new file mode 100644 index 00000000..fc256028 --- /dev/null +++ b/tests/data/sample1.sssom.tsv @@ -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 \ No newline at end of file