class Request(object): def __init__(self): from sdh.curator.actions.core import CURATOR, AMQP self._graph = CGraph() self._graph.bind('curator', CURATOR) self._graph.bind('amqp', AMQP) self._request_node = None self._fields = {} def parse(self, message): log.debug('Parsing message...') try: self._graph.parse(StringIO.StringIO(message), format='turtle') except Exception, e: raise SyntaxError(e.message) self._extract_content()