# -*- coding: utf-8 -*-
from .urn import Urn
from fdi.dataset.odict import ODict
import logging
# create logger
logger = logging.getLogger(__name__)
# logger.debug('level %d' % (logger.getEffectiveLevel()))
[docs]class Taggable(object):
"""
Definition of services provided by a product storage supporting tagging.
"""
def __init__(self, **kwds):
super(Taggable, self).__init__(**kwds)
# {tag->{'urns':[urn]}
# {urn->{'tags':[tag], 'meta':meta}}
[docs] def getTagUrnMap(self):
"""
Get the full tag->urn mappings.
mh: returns an iterator
"""
raise NotImplementedError
[docs] def getUrn(self, tag):
"""
Gets the URNs corresponding to the given tag. Returns an empty list if tag does not exist.
"""
raise NotImplementedError
[docs] def getUrnObject(self, tag):
"""
Gets the URNobjects corresponding to the given tag.
"""
raise NotImplementedError
[docs] def removeTag(self, tag):
"""
Remove the given tag from the tag and urn maps.
"""
raise NotImplementedError
[docs] def removeUrn(self, urn=None, datatype=None, sn=None):
"""
Remove the given urn from the tag and urn maps.
"""
raise NotImplementedError
[docs] def setTag(self, tag, urn=None, datatype=None, sn=None):
"""
Sets the specified tag to the given URN.
"""
raise NotImplementedError
[docs] def tagExists(self, tag):
"""
Tests if a tag exists.
"""
raise NotImplementedError