datacatalog.linkedstores.association package

Submodules

datacatalog.linkedstores.association.document module

class datacatalog.linkedstores.association.document.Association(*args, **kwargs)[source]

Bases: attrdict.dictionary.AttrDict

class datacatalog.linkedstores.association.document.AssociationDocument(schema=None, **kwargs)[source]

Bases: datacatalog.extensible.ExtensibleAttrDict

Instantiates an Annotation Association

CONNECTS_FROM_MAX_LENGTH = 1
CONNECTS_FROM_UUIDTYPES = ('tag_annotation', 'text_annotation')
CONNECTS_TO_MAX_LENGTH = 1
CONNECTS_TO_UUIDTYPES = ('challenge_problem', 'experiment_design', 'experiment', 'sample', 'measurement', 'file', 'reference', 'process', 'pipeline', 'pipelinejob')
DELETE_FIELD = '_visible'
PARAMS = [('owner', True, 'owner', None), ('connects_to', True, 'connects_to', []), ('connects_from', True, 'connects_from', []), ('note', False, 'note', None), ('_visible', False, '_visible', True)]
class datacatalog.linkedstores.association.document.AssociationSchema(inheritance=True, **kwargs)[source]

Bases: datacatalog.linkedstores.basestore.heritableschema.HeritableDocumentSchema

Defines the Annotation Association schema

DELETE_FIELD = '_visible'

datacatalog.linkedstores.association.exceptions module

exception datacatalog.linkedstores.association.exceptions.AssociationError[source]

Bases: datacatalog.linkedstores.basestore.exceptions.CatalogError

datacatalog.linkedstores.association.schemas module

datacatalog.linkedstores.association.schemas.get_schemas()[source]

Get JSON schemas for AssociationDocument

Returns:Object and document JSON schema that define the store
Return type:JSONSchemaCollection

datacatalog.linkedstores.association.store module

class datacatalog.linkedstores.association.store.AssociationStore(mongodb, config={}, session=None, **kwargs)[source]

Bases: datacatalog.linkedstores.basestore.softdelete.SoftDelete, datacatalog.linkedstores.basestore.store.LinkedStore

Manage association records

associate(annotation_uuid, record_uuid, note='', owner=None, token=None)[source]

Create an association between an annotation and a metadata record

Parameters:
  • annotation_uuid (str) – UUID5 for the annotation (connects_from)
  • record_uuid (str) – UUID5 for a metadata record (connects_to)
  • note (str, optional) – Optional brief explanation of the association
  • owner (str, optional) – TACC.cloud username owning the association
Returns:

UUID5 of the resulting association

Return type:

str

Raises:
  • AssociationError – A failure prevented the association from being created
  • ValueError – Either the annotation or record UUID was the wrong type
dissociate(annotation_uuid, record_uuid, owner=None, token=None)[source]

Remove an association between an annotation and a metadata record

This uses a soft-delete function, which simply toggles a visibility key

Parameters:
  • annotation_uuid (str) – UUID5 for the annotation (connects_from)
  • record_uuid (str) – UUID5 for a metadata record (connects_to)
  • owner (str) – TACC.cloud username owning the association
Returns:

UUID5 of the resulting association

Return type:

str

Raises:
  • AssociationError – A failure prevented the association from being created
  • ValueError – Either the annotation or record UUID was the wrong type
class datacatalog.linkedstores.association.store.StoreInterface(mongodb, config={}, session=None, **kwargs)[source]

Bases: datacatalog.linkedstores.association.store.AssociationStore