17.6.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 opg4j> import oracle.pgx.config.mllib.ActivationFunction opg4j> import oracle.pgx.config.mllib.WeightInitScheme
import oracle.pgx.api.*; import oracle.pgx.api.mllib.UnsupervisedAnomalyDetectionGraphWiseModel; import oracle.pgx.api.frames.*; import oracle.pgx.config.mllib.ActivationFunction; import oracle.pgx.config.mllib.GraphWiseConvLayerConfig; import oracle.pgx.config.mllib.UnsupervisedAnomalyDetectionGraphWiseModelConfig; import oracle.pgx.config.mllib.GraphWiseEmbeddingConfig; import oracle.pgx.config.mllib.corruption.PermutationCorruption; import oracle.pgx.config.mllib.WeightInitScheme;
# starting the Python shell will create an implicit session and analyst
- Load the graph.
opg4j> var instance = GraphServer.getInstance("https://localhost:7007", "<username>", "<password>".toCharArray()) opg4j> var session=instance.createSession("mySession") opg4j> var graph = session.readGraphByName("<graph_name>",GraphSource.PG_VIEW)
ServerInstance instance = GraphServer.getInstance("https://localhost:7007", "<username>", "<password>".toCharArray()); PgxSession session = instance.createSession("my-session"); PgxGraph graph = session.readGraphByName("<graph_name>",GraphSource.PG_VIEW);
instance = graph_server.get_instance("https://localhost:7007","<username>","<password>") session = instance.create_session("my_session") graph = session.read_graph_by_name("<graph_name>", "pg_view")