code: def parents(self, node, relations=None):
          
          g = self.get_graph()
          if node in g:
              parents = list(g.predecessors(node))
              if relations is None:
                  return parents
              else:
                  rset = set(relations)
                  return [p for p in parents if len(self.child_parent_relations(node, p, graph=g).intersection(rset)) > 0 ]
          else:
              return []
docs: Return all direct parents of specified node.
  
          Wraps networkx by default.
  
          Arguments
          ---------
          node: string
             identifier for node in ontology
          relations: list of strings
             list of relation (object property) IDs used to filter