Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If NameLoad body Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Delete SubscriptDel NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr orelse Raise Call AttributeLoad NameLoad attr BinOpAdd Str Call AttributeLoad Call NameLoad Str attr keyword NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str Str body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListComp SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If CompareGt Call AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If Call NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr ListLoad NameLoad attr orelse Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad If CompareIs NameLoad NameLoad body Return ListLoad NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body If BoolOpAnd CompareEq AttributeLoad NameLoad attr NameLoad CompareEq AttributeLoad NameLoad attr Str body Return ListLoad NameLoad Return ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A 
Annotation storage API.

This module provides the core API with access to basic persistence functions
for storing and retrieving annotations. Data passed to these functions is
assumed to be validated.
 functools partial pyramid i18n h.api schemas h.api transform h.api models h.api.events AnnotationBeforeSaveEvent N/A _ N/A N/A i18n TranslationStringFactory __package__ annotation_from_dict N/A N/A data N/A N/A N/A 
    Create an annotation model object from the passed dict, without saving.

    :param data: a dictionary of annotation properties
    :type data: dict

    :returns: the created annotation
    :rtype: dict
     N/A N/A N/A N/A models elastic Annotation data N/A fetch_annotation N/A N/A request id _postgres N/A None N/A N/A 
    Fetch the annotation with the given id.

    :param request: the request object
    :type request: pyramid.request.Request

    :param id: the annotation id
    :type id: str

    :returns: the annotation, if found, or None.
    :rtype: dict, NoneType
     N/A N/A _postgres None N/A N/A _postgres N/A _postgres_enabled request N/A _postgres N/A N/A N/A N/A N/A N/A N/A request db query N/A models Annotation get id N/A N/A N/A N/A N/A models elastic Annotation fetch id N/A legacy_create_annotation N/A N/A request data N/A N/A N/A annotation N/A N/A N/A models elastic Annotation data N/A N/A _prepare request annotation N/A N/A N/A annotation save N/A annotation N/A create_annotation N/A N/A request data N/A N/A N/A 
    Create an annotation from passed data.

    :param request: the request object
    :type request: pyramid.request.Request

    :param data: a dictionary of annotation properties
    :type data: dict

    :returns: the created annotation
    :rtype: dict
     N/A document_uri_dicts N/A N/A data N/A document N/A document_uri_dicts N/A document_meta_dicts N/A N/A data N/A document N/A document_meta_dicts N/A N/A data N/A document N/A N/A data N/A references N/A N/A top_level_annotation_id N/A N/A data N/A references N/A 0 N/A top_level_annotation N/A fetch_annotation request top_level_annotation_id _postgres True N/A top_level_annotation N/A N/A N/A data N/A groupid N/A top_level_annotation groupid N/A N/A N/A N/A schemas ValidationError N/A references.0:  N/A N/A N/A _ Annotation {annotation_id} does not exist format annotation_id top_level_annotation_id N/A N/A N/A data N/A groupid __world__ N/A N/A group_principal N/A N/A group:{} format N/A data N/A groupid N/A N/A group_principal N/A request effective_principals N/A N/A N/A N/A schemas ValidationError N/A group:  N/A _ You may not create annotations in groups you are not a member of! N/A annotation N/A N/A models Annotation data N/A N/A N/A N/A request db add annotation N/A N/A N/A N/A request db flush N/A documents N/A N/A N/A models Document find_or_create_by_uris N/A request db N/A annotation target_uri N/A N/A u N/A uri N/A u document_uri_dicts created N/A annotation created updated N/A annotation updated N/A N/A N/A N/A documents count 1 N/A N/A document N/A N/A models merge_documents N/A request db documents updated N/A annotation updated N/A N/A document N/A N/A documents first N/A N/A document updated N/A annotation updated N/A document_uri_dict document_uri_dicts N/A N/A N/A N/A models create_or_update_document_uri session N/A request db document document created N/A annotation created updated N/A annotation updated document_uri_dict N/A document_meta_dict document_meta_dicts N/A N/A N/A N/A models create_or_update_document_meta session N/A request db document document created N/A annotation created updated N/A annotation updated document_meta_dict N/A annotation N/A update_annotation N/A N/A request id data N/A N/A N/A 
    Update the annotation with the given id from passed data.

    This executes a partial update of the annotation identified by `id` using
    the passed data.

    :param request: the request object
    :type request: pyramid.request.Request

    :param id: the annotation id
    :type id: str

    :param data: a dictionary of annotation properties
    :type data: dict

    :returns: the updated annotation
    :rtype: dict
     N/A annotation N/A N/A N/A N/A models elastic Annotation fetch id N/A N/A N/A annotation update data N/A N/A _prepare request annotation N/A N/A N/A annotation save N/A annotation N/A delete_annotation N/A N/A request id N/A N/A N/A 
    Delete the annotation with the given id.

    :param request: the request object
    :type request: pyramid.request.Request

    :param id: the annotation id
    :type id: str
     N/A N/A _postgres_enabled request N/A N/A annotation N/A fetch_annotation request id _postgres True N/A N/A N/A N/A request db delete annotation N/A legacy_annotation N/A fetch_annotation request id _postgres False N/A N/A N/A legacy_annotation delete N/A expand_uri N/A N/A request uri N/A N/A N/A 
    Return all URIs which refer to the same underlying document as `uri`.

    This function determines whether we already have "document" records for the
    passed URI, and if so returns the set of all URIs which we currently
    believe refer to the same document.

    :param request: the request object
    :type request: pyramid.request.Request

    :param uri: a URI associated with the document
    :type id: str

    :returns: a list of equivalent URIs
    :rtype: list
     N/A doc None N/A N/A _postgres_enabled request N/A N/A doc N/A N/A N/A N/A N/A models Document find_by_uris N/A request db N/A uri one_or_none N/A N/A doc N/A N/A N/A N/A models elastic Document get_by_uri uri N/A N/A doc None N/A N/A N/A uri N/A docuris N/A doc document_uris N/A docuri docuris N/A N/A N/A N/A N/A docuri uri uri N/A N/A docuri type rel-canonical N/A N/A N/A uri N/A N/A N/A docuri uri N/A docuri docuris N/A _prepare N/A N/A request annotation N/A N/A N/A Prepare the given annotation for storage. N/A fetcher N/A partial fetch_annotation request _postgres False N/A N/A N/A transform prepare annotation fetcher N/A event N/A AnnotationBeforeSaveEvent request annotation N/A N/A N/A N/A request registry notify event N/A _postgres_enabled N/A N/A request N/A N/A N/A N/A N/A request feature postgres N/A