'Given a JSON representation of all the models in a graph, return a
dict of new model objects.'

@classmethod
def _instantiate_references_json(cls, references_json):

    references = {}
    for obj in references_json:
        obj_id = obj['id']
        obj_type = obj.get('subtype', obj['type'])
        cls = get_class(obj_type)
        instance = cls(id=obj_id, _block_events=True)
        if (instance is None):
            raise RuntimeError(('Error    loading    model    from    JSON    (type:    %s,    id:    %s)' % (obj_type, obj_id)))
        references[instance._id] = instance
    return references
