code: def test_graph_is_built_as_expected(self):
      g1 = nx.MultiDiGraph()
      g1.add_node("x")
  
      g2 = nx.MultiDiGraph()
      g2.add_node("x")
      g2.add_node("n")
      g2.add_edge("x", "n", type="has")
  
      g3 = nx.MultiDiGraph()
      g3.add_node("x")
      g3.add_node("r")
      g3.add_node("y")
      g3.add_edge("r", "x", type="child")
      g3.add_edge("r", "y", type="parent")
  
      queries = [
          Query(g1, "match $x iid V123;"),
          Query(g2, "match $x iid V123, has name $n;"),
          Query(g3, "match $x iid V123; $r(child: $x, parent: $y);"),
      ]
  
      class MockTransaction:
          def query(self):
              return MockQueryManager()
  
      class MockQueryManager:
          def match(self, query):
              if query == "match $x iid V123;":
                  return [
                      MockConceptMap(
                          {
                              "x": MockThing(
                                  "V123",
                                  MockType("V4123", "person", "ENTITY"),
                              )
                          }
                      )
                  ]
              elif query == "match $x iid V123, has name $n;":
                  return [
                      MockConceptMap(
                          {
                              "x": MockThing(
                                  "V123",
                                  MockType("V4123", "person", "ENTITY"),
                              ),
                              "n": MockAttribute(
                                  "V987",
                                  "Bob",
                                  MockAttributeType(
                                      "V555",
                                      "name",
                                      "ATTRIBUTE",
                                      AttributeType.ValueType.STRING,
                                  ),
                              ),
                          }
                      )
                  ]
              elif (
                  query
                  == "match $x iid V123; $r(child: $x, parent: $y);"
              ):
                  return [
                      MockConceptMap(
                          {
                              "x": MockThing(
                                  "V123",
                                  MockType("V4123", "person", "ENTITY"),
                              ),
                              "y": MockThing(
                                  "V123",
                                  MockType("V4123", "person", "ENTITY"),
                              ),
                              "r": MockThing(
                                  "V567",
                                  MockType(
                                      "V9876", "parentship", "RELATION"
                                  ),
                              ),
                          }
                      )
                  ]
              else:
                  raise NotImplementedError
  
      mock_tx = MockTransaction()
  
      combined_graph = build_graph_from_queries(queries, mock_tx)
  
      person_exp = Thing("V123", "person", "entity")
      parentship_exp = Thing("V567", "parentship", "relation")
      name_exp = Thing(
          "V987",
          "name",
          "attribute",
          value_type=AttributeType.ValueType.STRING,
          value="Bob",
      )
      expected_combined_graph = nx.MultiDiGraph()
      expected_combined_graph.add_node(person_exp, type="person")
      expected_combined_graph.add_node(
          name_exp,
          type="name",
          value_type=AttributeType.ValueType.STRING,
          value="Bob",
      )
      expected_combined_graph.add_node(
          parentship_exp, type="parentship"
      )
      expected_combined_graph.add_edge(
          parentship_exp, person_exp, type="child"
      )
      expected_combined_graph.add_edge(
          parentship_exp, person_exp, type="parent"
      )
      expected_combined_graph.add_edge(person_exp, name_exp, type="has")
  
      self.assertGraphsEqual(expected_combined_graph, combined_graph)
  
imports: import unittest
  import networkx
  from typedb.api.concept.type.attribute_type import AttributeType
  from typedb_ml.networkx.graph_test_case import GraphTestCase
  from typedb_ml.networkx.queries_to_networkx import concept_dict_from_concept_map, combine_n_graphs, build_graph_from_queries
  from typedb_ml.networkx.query_graph import Query
  from typedb_ml.typedb.test.mock.answer import MockConceptMap
  from typedb_ml.typedb.test.mock.concept import MockType, MockAttributeType, MockThing, MockAttribute
  from typedb_ml.typedb.thing import Thing
label_desc: Use image node_id 1 for calling the TestBuildGraphFromQueries obj's underlying member method code with example usage: obj.test_graph_is_built_as_expected() and returns: MockQueryManager, list, list, list