def evalInsertData(ctx, u):
    # add triples
    g = ctx.graph
    g += u.triples

    # add quads
    # u.quads is a dict of graphURI=>[triples]
    for g in u.quads:
        cg = ctx.dataset.get_context(g)
        cg += u.quads[g]
http://www.w3.org/TR/sparql11-update/#insertData
dataset/ETHPy150Open RDFLib/rdflib/rdflib/plugins/sparql/update.py/evalInsertData