<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def children(self, node, relations=None):
 """ Return all direct children 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 """

        g = self.get_graph()
        if node in g:
            children = list(g.successors(node))
            if relations is None:
                return children
            else:
                rset = set(relations)
                return [c for c in children if len(self.child_parent_relations(c, node, graph=g).intersection(rset)) > 0 ]
        else:
            return []