class momaapi.lookup.Lookup(dir_moma, taxonomy, reset_cache)#

Lookup utility class to help lookup annotations.

map_id(kind, id_act=None, id_sact=None, id_hoi=None)#

Maps instance IDs across the MOMA hierarchy. Usage:

  • Convert an id_act into ids_sact (one-to-many):

    map_id(id_act=id_act, kind='sact')

  • Convert an id_act into ids_hoi (one-to-many):

    map_id(id_act=id_act, kind='hoi')

  • Convert an id_sact into id_act (one-to-one):

    map_id(id_sact=id_sact, kind='act')

  • Convert an id_sact into ids_hoi (one-to-many):

    map_id(id_sact=id_sact, kind='hoi')

  • Convert an id_hoi into id_sact (one-to-one):

    map_id(id_hoi=id_hoi, kind='sact')

  • Convert an id_hoi into id_act (one-to-one):

    map_id(id_hoi=id_hoi, kind='act')

retrieve(kind, key=None)#

Accesses the value given a key. There are several different ways to retrieve:

  • Convert a split into ids_act (one-to-many):

    retrieve(kind='id_act', key=split)

  • Convert an id_act into an ann_act, metadatum (one-to-one):

    retrieve(kind='ann_act' or 'metadatum', key=id_act)

  • Convert an id_sact into an ann_sact (one-to-one):

    retrieve(kind='ann_sact', key=id_sact)

  • Convert an id_hoi into an ann_hoi or a clip (one-to-one):

    retrieve(kind='ann_hoi' or 'clip', key=id_hoi)


kind (Literal["paradigms","splits","ids_act","ids_sact","ids_hoi","anns_act","metadata","anns_sact","anns_hoi","clips",]) – indicates the type of retrieval that is used