code: def test_read_from_json_handles_simple_cases(self):
      json = {
          "question": [
              Token(x) for x in ["where", "is", "mersin", "?"]
          ],
          "columns": ["Name in English", "Location"],
          "cells": [["Paradeniz", "Mersin"], ["Lake Gala", "Edirne"]],
      }
      graph = TableQuestionKnowledgeGraph.read_from_json(json)
      neighbors = set(graph.neighbors["fb:cell.mersin"])
      assert graph.entities == [
          "-1",
          "0",
          "1",
          "fb:cell.edirne",
          "fb:cell.lake_gala",
          "fb:cell.mersin",
          "fb:cell.paradeniz",
          "fb:row.row.location",
          "fb:row.row.name_in_english",
      ]
      assert neighbors == set(["fb:row.row.location"])
      neighbors = set(graph.neighbors["fb:row.row.name_in_english"])
      assert neighbors == set(
          ["fb:cell.paradeniz", "fb:cell.lake_gala"]
      )
      assert graph.entity_text["fb:cell.edirne"] == "Edirne"
      assert graph.entity_text["fb:cell.lake_gala"] == "Lake Gala"
      assert graph.entity_text["fb:cell.mersin"] == "Mersin"
      assert graph.entity_text["fb:cell.paradeniz"] == "Paradeniz"
      assert graph.entity_text["fb:row.row.location"] == "Location"
      assert (
          graph.entity_text["fb:row.row.name_in_english"]
          == "Name in English"
      )
  
      # These are default numbers that should always be in the graph.
      assert graph.neighbors["-1"] == []
      assert graph.neighbors["0"] == []
      assert graph.neighbors["1"] == []
      assert graph.entity_text["-1"] == "-1"
      assert graph.entity_text["0"] == "0"
      assert graph.entity_text["1"] == "1"
  
imports: from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token
  from allennlp.semparse.contexts import TableQuestionKnowledgeGraph
label_desc: Use image node_id 1 for calling the TestTableQuestionKnowledgeGraph obj's underlying member method code with example usage: obj.test_read_from_json_handles_simple_cases() without return types