$resource_ref, 'resource_type_field' => $rtf_tags, 'page' => 0, 'tags' => [$node_optionA], 'shapes' => [ [ 'type' => 'rect', 'geometry' => [ 'x' => 0.10, 'y' => 0.20, 'width' => 0.50, 'height' => 0.60, ], ] ], ]; $annotation_ref = createAnnotation($annotorious_annotation); $annotation = $annotorious_annotation; $annotation['tags'] = [$node_optionB]; // Update tags but missing its ID if (updateAnnotation($annotation) !== false) { echo 'updateAnnotation (no ref) - '; return false; } // Update tags for an existing annotation $annotation['ref'] = $annotation_ref; if (updateAnnotation($annotation) === false) { echo 'updateAnnotation - '; return false; } // Tear down unset($rtf_tags, $node_optionA, $node_optionB, $resource_ref, $annotorious_annotation, $annotation); return true;