

def evalUpdate(graph, update, initBindings=None):
    "\n\n    http://www.w3.org/TR/sparql11-update/#updateLanguage\n\n    'A request is a sequence of operations [...] Implementations MUST\n    ensure that operations of a single request are executed in a\n    fashion that guarantees the same effects as executing them in\n    lexical order.\n\n    Operations all result either in success or failure.\n\n    If multiple operations are present in a single request, then a\n    result of failure from any operation MUST abort the sequence of\n    operations, causing the subsequent operations to be ignored.'\n\n    This will return None on success and raise Exceptions on error\n\n    "
    for u in update:
        ctx = QueryContext(graph)
        ctx.prologue = u.prologue
        if initBindings:
            for (k, v) in initBindings.iteritems():
                if (not isinstance(k, Variable)):
                    k = Variable(k)
                ctx[k] = v
        try:
            if (u.name == 'Load'):
                evalLoad(ctx, u)
            elif (u.name == 'Clear'):
                evalClear(ctx, u)
            elif (u.name == 'Drop'):
                evalDrop(ctx, u)
            elif (u.name == 'Create'):
                evalCreate(ctx, u)
            elif (u.name == 'Add'):
                evalAdd(ctx, u)
            elif (u.name == 'Move'):
                evalMove(ctx, u)
            elif (u.name == 'Copy'):
                evalCopy(ctx, u)
            elif (u.name == 'InsertData'):
                evalInsertData(ctx, u)
            elif (u.name == 'DeleteData'):
                evalDeleteData(ctx, u)
            elif (u.name == 'DeleteWhere'):
                evalDeleteWhere(ctx, u)
            elif (u.name == 'Modify'):
                evalModify(ctx, u)
            else:
                raise Exception(('Unknown update operation: %s' % (u,)))
        except:
            if (not u.silent):
                raise

dataset/ETHPy150Open RDFLib/rdflib/rdflib/plugins/sparql/update.py evalUpdate/original