diff --git a/src/pyobo/struct/struct.py b/src/pyobo/struct/struct.py index d9f53760..4d399f6d 100644 --- a/src/pyobo/struct/struct.py +++ b/src/pyobo/struct/struct.py @@ -322,7 +322,7 @@ def get_relationships(self, typedef: TypeDef) -> List[Reference]: """Get relationships from the given type.""" return self.relationships[typedef] - def append_exact_match(self, reference): + def append_exact_match(self, reference: ReferenceHint): """Append an exact match, also adding an xref.""" reference = _ensure_ref(reference) self.append_relationship(exact_match, reference) @@ -363,11 +363,11 @@ def extend_relationship(self, typedef: TypeDef, references: Iterable[Reference]) raise ValueError("can not extend a collection that includes a null reference") self.relationships[typedef].extend(references) - def append_property(self, prop: Union[str, TypeDef], value: Union[str, Reference]) -> None: + def append_property( + self, prop: Union[str, TypeDef], value: Union[str, Reference, Referenced] + ) -> None: """Append a property.""" - if isinstance(prop, TypeDef): - prop = prop.curie - if isinstance(value, Reference): + if isinstance(value, (Reference, Referenced)): value = value.curie self.properties[prop].append(value)