<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_json(cls, json_graph):
 """ Reconstruct the graph from a graph exported to JSON. """

        obj = json.loads(json_graph)

        vertices = [
            AnnotatedVertex(
                id=vertex["id"],
                annotation=vertex["annotation"],
            )
            for vertex in obj["vertices"]
        ]

        edges = [
            AnnotatedEdge(
                id=edge["id"],
                annotation=edge["annotation"],
                head=edge["head"],
                tail=edge["tail"],
            )
            for edge in obj["edges"]
        ]

        return cls(vertices=vertices, edges=edges)