8.4.1 Loading a Graph
The following describes the steps for loading a graph:
- Create a Session and an Analyst.
cd /opt/oracle/graph/ ./bin/opg4j // starting the shell will create an implicit session and analyst
import oracle.pgx.api.*; import oracle.pgx.api.mllib.Pg2vecModel; import oracle.pgx.api.frames.*; ... PgxSession session = Pgx.createSession("my-session"); Analyst analyst = session.createAnalyst();
session = pypgx.get_session(session_name="my-session") analyst = session.create_analyst()
- Load the graph.
opg4j> var graph = session.readGraphWithProperties("<path>/<graph.json>")
PgxGraph graph = session.readGraphWithProperties("<path>/<graph.json>");
graph = session.read_graph_with_properties("<path>/<graph.json>")
Parent topic: Using the Pg2vec Algorithm