8.3.1 Loading a Graph

The following describes the steps for loading a graph:
  1. Create a Session and an Analyst.
    Creating a Session and an Analyst Using JShell
    
    cd /opt/oracle/graph/
    ./bin/opg4j
    // starting the shell will create an implicit session and analyst
    
    Creating a Session and an Analyst Using Java
    import oracle.pgx.api.*;
    import oracle.pgx.api.mllib.UnsupervisedGraphWiseModel;
    import oracle.pgx.api.frames.*;
    import oracle.pgx.config.mllib.ActivationFunction;
    import oracle.pgx.config.mllib.GraphWiseConvLayerConfig;
    import oracle.pgx.config.mllib.UnsupervisedGraphWiseModelConfig;
    import oracle.pgx.config.mllib.WeightInitScheme;
    
    PgxSession session = Pgx.createSession("my-session");
    Analyst analyst = session.createAnalyst();
    Creating a Session and an Analyst Using Python
    session = pypgx.get_session()
    analyst = session.analyst
  2. Load the graph.
    Loading a graph using JShell
    opg4j> var graph = session.readGraphWithProperties("<path/to/graph_config.json>");
    
    Loading a graph using Java
    PgxGraph graph = session.readGraphWithProperties("<path/to/graph_config.json>");
    
    Loading a graph using Python
    graph = session.readGraphWithProperties("<path/to/graph_config.json>")

    You do not need to use a test graph or test vertices, since the model is trained to be unsupervised.