def METHOD_NAME(self, graph: Graph, output: io.TextIOBase) -> None:
    """Write a full Dot graph representation to output.
    Args:
        graph(Graph): RDFLib graph.
        output(io.TextIOBase): The output stream to write to.
    """
    types = collections.defaultdict(set)
    fields = collections.defaultdict(set)
    nodes: Dict[str, str] = {}
    def node(x):
        """Return a name of the given node."""
        return nodes.setdefault(x, f"node{len(nodes)}")
    def label(x, g):
        """Generate a label for the node."""
        for labelProp in LABEL_PROPERTIES:
            label_ = g.value(x, labelProp)
            if label_:
                return label_
        try:
            return g.namespace_manager.compute_qname(x)[2]
        except Exception:
            return x
    def formatliteral(literal, g):
        """Format and escape literal."""
        v = html.escape(literal)
        if literal.datatype:
            return f"&quot;{v}&quot;^^{qname(literal.datatype, g)}"
        elif literal.language:
            return f"&quot;{v}&quot;@{literal.language}"
        return "&quot;%s&quot;" % v
    def qname(x, g):
        """Compute qname."""
        try:
            q = g.compute_qname(x)
            return q[0] + ":" + q[2]
        except Exception:
            return x
    def color(p):
        """Choose node color."""
        return "BLACK"
    # filter out nodes and edges created for directories
    sparql = """
    SELECT ?s ?p ?o
    WHERE {
        ?s ?p ?o
        MINUS {
            ?s rdf:type prov:Collection.
        }
        MINUS {
            VALUES ?exclude { prov:wasInformedBy prov:influenced rdf:label }
            ?s ?exclude ?o.
        }
    }
    """
    for s, p, o in cast(Iterator[ResultRow], graph.query(sparql)):
        sn = node(s)
        if p == rdflib.RDFS.label:
            continue
        # inject the type predicate into the node itself
        if p == rdflib.RDF.type:
            types[sn].add((qname(p, graph), html.escape(o)))
            continue
        # add the project membership to the node
        if p == rdflib.term.URIRef("schema:isPartOf"):
            fields[sn].add((qname(p, graph), html.escape(o)))
            continue
        if isinstance(o, (rdflib.URIRef, rdflib.BNode)):
            on = node(o)
            opstr = '\t%s -> %s [ color=%s, label=< <font point-size="12" ' 'color="#336633">%s</font> > ] ;\n'
            output.write(opstr % (sn, on, color(p), qname(p, graph)))
        else:
            fields[sn].add((qname(p, graph), formatliteral(o, graph)))
    for u, n in nodes.items():
        output.write(f"# {u} {n}\n")
        f = [
            '<tr><td align="left"><b>%s</b></td><td align="left">' "<b>%s</b></td></tr>" % x
            for x in sorted(types[n])
        ]
        f += ['<tr><td align="left">%s</td><td align="left">%s</td></tr>' % x for x in sorted(fields[n])]
        opstr = (
            '%s [ shape=none, color=%s label=< <table color="#666666"'
            ' cellborder="0" cellspacing="0" border="1"><tr>'
            '<td colspan="2" bgcolor="grey"><B>%s</B></td></tr><tr>'
            '<td href="%s" bgcolor="#eeeeee" colspan="2">'
            '<font point-size="12" color="#6666ff">%s</font></td>'
            "</tr>%s</table> > ] \n"
        )
        output.write(opstr % (n, NODECOLOR, label(u, graph), u, u, "".join(f)))
    output.write("}\n")