PGX exposes its functionality via asynchronous Java APIs. Each asynchronous method has a synchronous equivalent, which blocks the caller thread until the server produces a response. These APIs may perform one or any combination of:
Note: By design, it is transparent to the caller whether the API is talking to a local or remote PGX instance.
The PGX API is composed of a few different Java interfaces. Each interface provides a distinct layer of abstraction for PGX.
ServerInstance class encapsulates access to a PGX server instance and can be used to create sessions, start and
stop the PGX engine, monitor the engine status and perform other administrative tasks. If the instance points to a
remote instance, access to the administrative functions requires special authorization on the HTTP level by default.
PgxSession represents an active user currently connected to an instance. Each session gets its own workspace on the
server side which can be used to read graphs, create in-memory data structures, hold analysis results and custom
PgxSession class provides various methods to create new transient data (currently collections).
If a session is idling for too long, the PGX engine will automatically destroy it to ensure no resources
PgxGraph represents a client-side handle to the graph data managed by the PGX server. A graph may contain an
arbitrary amount of properties of type
EdgeProperty. Note: PGX currently only supports
non-partitioned graphs, meaning every vertex/edge has the same properties with the same names and types as all the
other vertices/edges. The
PgxGraph class provides various methods to create new transient data (including maps and
collections) as well as graph mutation operations, such as undirecting, sorting and filtering.
Analyst API contains all of the built-in algorithms PGX provides.
Analyst objects keep track of all the transient
data they created during algorithm invocations to hold analysis results. Once an
Analyst gets destroyed, all the
results it created get freed on the server-side automatically.
CompiledProgram class encapsulates runtime-compiled custom algorithms (written in
Green-Marl) and allows invocation of those algorithms using PGX data objects,
VertexProperty, as arguments.
In the JavaDocs, all of the above APIs can be found in the