**************************************** Loading a Graph from Two Database Tables **************************************** Creating graph configuration ---------------------------- To load this graph into PGX, write a graphconfig. You can write the config in JSON format into a file: .. compound:: Notice that you will have to modify ``jdbc_url``, ``username`` and ``password`` according to your own database configuration. .. code-block:: python :linenos: # To load this graph into PGX, write a graph config. # You can write the config in JSON format into a file json = '''{ "format": "two_tables", "datastore": "rdbms", "jdbc_url": "jdbc:oracle:thin:@localhost:1521:rdbmsod", "username": "username", "password": "password", "keystore_alias": "database1", "nodes_table_name": "nodes", "edges_table_name": "edges", "error_handling": { "on_prop_conversion": "silent", "on_missed_prop_key": "log_warn_once" } }''' Actual Graph Loading -------------------- To load the graph data from the two tables into memory, simply write the graph config to :meth:`read_graph_with_properties()`. You can either write the path to the JSON file: .. code-block:: python :linenos: # To load the graph data from the two tables into memory # You can either write the path to the JSON file: session = pypgx.get_session() path = self.pgx_test_resources + "/graph-confs/sample.csv.gz.json" graph = session.read_graph_with_properties(path) or the config object directly if you built the config programmatically: .. code-block:: python :linenos: session = pypgx.get_session("my-session") graph = session.read_graph_with_properties(config)