Skip to content

Commit 8953ce5

Browse files
authored
Add new SSSOM field - record_id (#82)
Add output of SSSOM field for record_id which was added in mapping-commons/sssom#452. This field corresponds to an evidence's reference.
1 parent fc0d549 commit 8953ce5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/semra/io/io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ def _from_curie(curie: str, *, standardize: bool, name: str | None = None) -> Re
556556
class SSSOMRow(NamedTuple):
557557
"""A tuple representing a row in a SSSOM TSV file."""
558558

559+
record_id: str
559560
subject_id: str
560561
subject_label: str
561562
predicate_id: str
@@ -639,7 +640,7 @@ def _get_sssom_row(
639640
license = ""
640641
confidence = _format_confidence(e.confidence_factor)
641642
else:
642-
raise TypeError
643+
raise TypeError(f"invalid evidence type {type(e)} - {e}")
643644

644645
if add_labels:
645646
with logging_redirect_tqdm():
@@ -650,6 +651,7 @@ def _get_sssom_row(
650651
object_label = mapping.object.name or ""
651652

652653
return SSSOMRow(
654+
record_id=e.get_reference(mapping).curie,
653655
subject_id=mapping.subject.curie,
654656
subject_label=subject_label,
655657
predicate_id=mapping.predicate.curie,

0 commit comments

Comments
 (0)