14 PGX Programming Guides
You can avail all the PGX functionalities through 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:
- Complex, non-blocking Java applications on top of PGX
- Simple, sequential Java scripts executed by JShell
- ShellPerforming interactive graph analysis in the JShell
Layers of PGX API
The PGX API is composed of a few different Java interfaces. Each interface provides a distinct layer of abstraction for PGX, as shown in the following table:
Table 14-1 PGX API Interface
Interface | Description |
---|---|
ServerInstance |
The 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 |
A 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 algorithms. The 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 are wasted.
|
PgxGraph |
A 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 VertexProperty and/or EdgeProperty .
Note: The 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.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 |
The 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 |
The CompiledProgram class (PGX Algorithm API) encapsulates runtime-compiled custom algorithms and allows invocation of those algorithms using PGX data objects, such as PgxGraph or VertexProperty , as arguments.
|
Please see the oracle.pgx.api
package in the Javadoc for more details.
- Design of the Graph Server (PGX) API
This guide focuses on the design of the graph server (PGX) API. - Data Types and Collections in the Graph Server (PGX)
This guide provides you the list of the supported data types and collections in the graph server (PGX). - Handling Asynchronous Requests in Graph Server (PGX)
This guide explains in detail the asynchronous methods supported by the PGX API. - Graph Client Sessions
The graph server (PGX) assumes there may be multiple concurrent clients, and each client submits request to the shared PGX server independently. - Graph Mutation and Subgraphs
This guide discusses the several methods provided by the graph server (PGX) for mutating graph instances. - Graph Builder and Graph Change Set
- Managing Transient Data
This guide discusses how to handle transient properties and collections. - Graph Versioning
This guide describes the different ways to work with graph snapshots. - Labels and Properties
You can perform various actions on the graph property and label values by executing PGQL queries. - Filter Expressions
This guide explains the usage of filter expressions. - Advanced Task Scheduling Using Execution Environments
This guide shows how you can use the advanced scheduling features of the enterprise scheduler. - Admin API
This guide shows how to use the graph server (PGX) Admin API to inspect the server state including sessions, graphs, tasks, memory and thread pools. - PgxFrames Tabular Data-Structure
Parent topic: Graph Server (PGX) Advanced User Guide