code: def query(self, s=None, p=None, o=None):
          
          start, end = self.keys_for_query(s, p, o)
          if end is None:
              if start in self._z:
                  yield {'s': s, 'p': p, 'o': o}
              else:
                  raise StopIteration
          else:
              for key in self._z.range_by_lex('[' + start, '[' + end):
                  keys, p1, p2, p3 = decode(key).split('::')
                  yield dict(zip(keys, (p1, p2, p3)))
docs: Return all triples that satisfy the given expression. You may specify
          all or none of the fields (s, p, and o). For instance, if I wanted
          to query for all the people who live in Kansas, I might write:
  
          .. code-block:: python
  
              for triple in graph.query(p='lives', o='Kansas'):
                  print triple['s'], 'lives in Kansas!'