Skip to content

Commit

Permalink
- Add: TestWrite.test_missing_entries()
Browse files Browse the repository at this point in the history
  • Loading branch information
joeflack4 committed May 20, 2024
1 parent 91d08b8 commit d9dd14f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/test_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,38 @@ def test_write_sssom_ontoportal_json(self):
self.mapping_count,
f"{path} has the wrong number of mappings.",
)

def test_missing_entries(self):
"""Test to make sure that missing entires do not appear"""
metadata = {
'creator_id': 'orcid:0000-0002-2906-7319',
'curie_map': {
'MONDO': 'http://purl.obolibrary.org/obo/MONDO_',
'Orphanet': 'http://www.orpha.net/ORDO/Orphanet_',
'icd11.foundation': 'http://id.who.int/icd/entity/',
'oboInOwl': 'http://www.geneontology.org/formats/oboInOwl#',
'orcid': 'https://orcid.org/',
'owl': 'http://www.w3.org/2002/07/owl#',
'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'rdfs': 'http://www.w3.org/2000/01/rdf-schema#',
'semapv': 'https://w3id.org/semapv/',
'skos': 'http://www.w3.org/2004/02/skos/core#',
'sssom': 'https://w3id.org/sssom/'
},
'license': 'http://w3id.org/sssom/license/unspecified',
'mapping_provider': 'https://www.orpha.net/'
}
import curies # TODO: put this at the top
converter = curies.Converter.from_prefix_map(metadata['curie_map'])
df = pd.DataFrame([{
'subject_id': 'Orphanet:58',
'subject_label': 'Alexander disease',
'predicate_id': 'skos:exactMatch',
'object_id': 'icd11.foundation:2023359698',
'object_label': 'Alexander disease',
'mapping_justification': 'semapv:UnspecifiedMatching'
}])
msdf: MappingSetDataFrame = MappingSetDataFrame(converter=converter, df=df, metadata=metadata)
# TODO: real outpath
with open('/Users/joeflack4/Desktop/temp.tsv', 'w') as f:
write_table(msdf, f)

0 comments on commit d9dd14f

Please sign in to comment.