- return txn.mutate(mu).then((res) => {
- assigned = res;
-
- // Commit transaction.
- return txn.commit();
- }).then(() => {
- // Get uid of the outermost object (person named "Alice").
- // Assigned#getUidsMap() returns a map from blank node names to uids.
- // For a json mutation, blank node names "blank-0", "blank-1", ... are used
- // for all the created nodes.
- console.log(`Created person named "Alice" with uid = ${assigned.getUidsMap().get("blank-0")}\n`);
-
- console.log("All created nodes (map from blank node names to uids):");
- assigned.getUidsMap().forEach((uid, key) => console.log(`${key}: ${uid}`));
- console.log();
- }).catch((e) => {
- err = e;
- }).then(() => {
- return txn.discard();
- }).then(() => {
- if (err != null) {