* Apply a parsed patch to the document's quads. Returns the new quad list.
* Throws PatchError(409) when the where clause does not match exactly once or a
* triple to delete is absent (both per the Solid protocol).
*/
exportfunctionapplyPatch(quads,patch){
letbindings=newMap();
if(patch.where.length){
constfound=solutions(patch.where,quads);
if(found.length!==1)thrownewPatchError(found.length ? 'The patch where clause matches more than once' : 'The patch where clause does not match the resource',409);