(patchObject, graph, url)
| 183 | |
| 184 | // Applies the patch to the RDF graph |
| 185 | function applyPatch (patchObject, graph, url) { |
| 186 | debug('PATCH -- Applying patch') |
| 187 | return new Promise((resolve, reject) => |
| 188 | graph.applyPatch(patchObject, graph.sym(url), (err) => { |
| 189 | if (err) { |
| 190 | const message = err.message || err // returns string at the moment |
| 191 | debug(`PATCH -- FAILED. Returning 409. Message: '${message}'`) |
| 192 | return reject(error(409, `The patch could not be applied. ${message}`)) |
| 193 | } |
| 194 | resolve(graph) |
| 195 | }) |
| 196 | ) |
| 197 | } |
| 198 | |
| 199 | // Writes the RDF graph to the given resource |
| 200 | function writeGraph (graph, resource, root, serverUri) { |
no test coverage detected