pub fn optimize_patch(patch: &RdfPatch) -> Result<RdfPatch>
Optimize patch by removing redundant operations