code: def _get_entity_coordinates(self, entity_term):
          sent_id = entity_term.get('sentence')
          if sent_id is None:
              return None
          qstr = "$.sentences.frames[(@.frame_id is \'%s')]" % sent_id
          res = self.tree.execute(qstr)
          if res is None:
              return None
          try:
              sentence = next(res)
          except StopIteration:
              return None
          sent_start = sentence.get('start-pos')
          if sent_start is None:
              return None
          sent_start = sent_start.get('offset')
          if sent_start is None:
              return None
          entity_start = entity_term.get('start-pos')
          entity_stop = entity_term.get('end-pos')
          if entity_start is None or entity_stop is None:
              return None
          entity_start = entity_start.get('offset')
          entity_stop = entity_stop.get('offset')
          if entity_start is None or entity_stop is None:
              return None
          return (entity_start - sent_start, entity_stop - sent_start)