def addNode(A,entity,nodes):
    nodeid= id(entity);
    name= str(entity);
    if nodeid not in nodes:
        A.add_node(name);
        nodes[nodeid]=entity;
    if isinstance(entity, SQE):
        for child in entity.MatchEntities:
            addNode(A,child,nodes);
            A.add_edge(name,str(child));
        for child in entity.RewriteEntities:
            addNode(A,child,nodes);
            A.add_edge(name,str(child));
    elif isinstance(entity, TE):
        for child in entity.Tables:
            addNode(A,child,nodes);
            A.add_edge(name,str(child));



    A.add_node(entity)
dataset/ETHPy150Open ferventdesert/tnpy/src/tngraph.py/addNode/original