Source code for MyCapytain.resolvers.prototypes

"""
.. module:: MyCapytain.resolvers.prototypes
   :synopsis: Resolver Prototype

.. moduleauthor:: Thibault Clérice <leponteineptique@gmail.com>


"""


[docs]class Resolver(object): """ Resolver provide a native python API which returns python objects. Initiation of resolvers are dependent on the implementation of the prototype """
[docs] def getMetadata(self, objectId=None, **filters): """ Request metadata about a text or a collection :param objectId: Object Identifier to filter on :type objectId: str :param filters: Kwargs parameters. :type filters: dict :return: Collection """ raise NotImplementedError()
[docs] def getTextualNode(self, textId, subreference=None, prevnext=False, metadata=False): """ Retrieve a text node from the API :param textId: CtsTextMetadata Identifier :type textId: str :param subreference: CapitainsCtsPassage Reference :type subreference: str :param prevnext: Retrieve graph representing previous and next passage :type prevnext: boolean :param metadata: Retrieve metadata about the passage and the text :type metadata: boolean :return: CapitainsCtsPassage :rtype: CapitainsCtsPassage """ raise NotImplementedError()
[docs] def getSiblings(self, textId, subreference): """ Retrieve the siblings of a textual node :param textId: CtsTextMetadata Identifier :type textId: str :param subreference: CapitainsCtsPassage Reference :type subreference: str :return: Tuple of references :rtype: (str, str) """ raise NotImplementedError()
[docs] def getReffs(self, textId, level=1, subreference=None): """ Retrieve the siblings of a textual node :param textId: CtsTextMetadata Identifier :type textId: str :param level: Depth for retrieval :type level: int :param subreference: CapitainsCtsPassage Reference :type subreference: str :return: List of references :rtype: [str] """ raise NotImplementedError()