def skolemize(self, new_graph=None, bnode=None):
        def do_skolemize(bnode, t):
            (s, p, o) = t
            if s == bnode:
                s = s.skolemize()
            if o == bnode:
                o = o.skolemize()
            return (s, p, o)

        def do_skolemize2(t):
            (s, p, o) = t
            if isinstance(s, BNode):
                s = s.skolemize()
            if isinstance(o, BNode):
                o = o.skolemize()
            return (s, p, o)

        retval = Graph() if new_graph is None else new_graph

        if bnode is None:
            self._process_skolem_tuples(retval, do_skolemize2)
        elif isinstance(bnode, BNode):
            self._process_skolem_tuples(
                retval, lambda t: do_skolemize(bnode, t))

        return retval
dataset/ETHPy150Open RDFLib/rdflib/rdflib/graph.py/Graph.skolemize/original