''

@classmethod
def _compute_patch_between_json(cls, from_json, to_json):

    def refs(json):
        result = {}
        for obj in json['roots']['references']:
            result[obj['id']] = obj
        return result
    from_references = refs(from_json)
    from_roots = {}
    from_root_ids = []
    for r in from_json['roots']['root_ids']:
        from_roots[r] = from_references[r]
        from_root_ids.append(r)
    to_references = refs(to_json)
    to_roots = {}
    to_root_ids = []
    for r in to_json['roots']['root_ids']:
        to_roots[r] = to_references[r]
        to_root_ids.append(r)
    from_root_ids.sort()
    to_root_ids.sort()
    from_set = set(from_root_ids)
    to_set = set(to_root_ids)
    removed = (from_set - to_set)
    added = (to_set - from_set)
    combined_references = dict(from_references)
    for k in to_references.keys():
        combined_references[k] = to_references[k]
    value_refs = {}
    events = []
    for removed_root_id in removed:
        model = dict(combined_references[removed_root_id])
        del model['attributes']
        events.append({'kind': 'RootRemoved', 'model': model})
    for added_root_id in added:
        Document._value_record_references(combined_references, combined_references[added_root_id], value_refs)
        model = dict(combined_references[added_root_id])
        del model['attributes']
        events.append({'kind': 'RootAdded', 'model': model})
    for id in to_references:
        if (id in from_references):
            update_model_events = Document._events_to_sync_objects(combined_references, from_references[id], to_references[id], value_refs)
            events.extend(update_model_events)
    return dict(events=events, references=list(value_refs.values()))
