It might be worth having a way to hash an EPM so they can be quickly indexed / compared for equality
def get_hash(self) -> str:
import hashlib
from operator import attrgetter
h = hashlib.md5()
for record in sorted(self.records, key=attrgetter("prefix")):
h.update(record.prefix.encode("utf8"))
h.update(record.uri_prefix.encode("utf8"))
for s in itt.chain(sorted(record.prefix_synonyms), sorted(record.uri_prefix_synonyms)):
h.update(s.encode("utf8"))
return h.hexdigest()
It might be worth having a way to hash an EPM so they can be quickly indexed / compared for equality