Skip to content

v0.5.0

Choose a tag to compare

@cthoyt cthoyt released this 14 Apr 13:30
· 78 commits to main since this release

This release implements the standard SSSOM hashing algorithm in #75:

from curies import NamedReference, Converter
from sssom_pydantic import SemanticMapping
from sssom_pydantic.api import hash_mapping

converter = Converter.from_prefix_map({
    "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
    "mesh": "http://id.nlm.nih.gov/mesh/",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "semapv": "https://w3id.org/semapv/vocab/",
})

mapping = SemanticMapping.exact(
    subject=NamedReference(prefix="mesh", identifier="C000089", name="ammeline"),
    object=NamedReference(prefix="CHEBI", identifier="28646", name="ammeline"),
)

>>> hash_mapping(mapping, converter)
'9D59EF306286DC1A'

This replaces the previous ad-hoc mapping hash, which has been removed.

Full Changelog: v0.4.2...v0.5.0