Class PgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>

java.lang.Object
oracle.pgx.api.subgraph.AbstractSubgraphReader<R>
oracle.pgx.api.subgraph.PgqlBasedSubgraphReader<R,P>
Type Parameters:
R - The subgraph loader type.
P - The prepared query type.
Direct Known Subclasses:
PgSqlSubgraphReader, PgViewSubgraphReader, PreparedPgSqlPgqlQuery, PreparedPgViewPgqlQuery

public abstract class PgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>> extends AbstractSubgraphReader<R>
Common base class for subgraph loaders that use PGQL queries to declare a subgraph.
  • Constructor Details

  • Method Details

    • withConfig

      public R withConfig(PartitionedGraphConfig config)
      sets the graph configuration to use for loading the subgraph. It has to correspond to a graph configuration for a graph that comes from a PG view.
      Parameters:
      config - the configuration of the graph to load
      Returns:
      this loader
    • dataSourceId

      public R dataSourceId(String dataSourceId)
      sets the dataSourceId to which to connect
      Parameters:
      dataSourceId - the datasourceId
      Returns:
      this loader
    • jdbcUrl

      public R jdbcUrl(String jdbcUrl)
      sets the jdbcUrl to use for connecting to the DB
      Parameters:
      jdbcUrl - the jdbc url
      Returns:
      this loader
    • username

      public R username(String userName)
      sets the username of the DB user to use to connect to the DB
      Parameters:
      userName - the username
      Returns:
      this loader
    • keystoreAlias

      public R keystoreAlias(String keystoreAlias)
      sets the keystore alias to retrieve the password from the keystore
      Parameters:
      keystoreAlias - the keystore alias
      Returns:
      this loader
    • password

      public R password(String password)
      sets the password to use for connecting to the database
      Parameters:
      password - the password
      Returns:
      this loader
    • connections

      public R connections(int numConnections)
      sets the number of connections to open to load the data in parallel
      Parameters:
      numConnections - the number of connections
      Returns:
      this loader
    • escapeKeysWithPgxSpecialCharacters

      public R escapeKeysWithPgxSpecialCharacters(boolean value)
      If this setting is applied, keys with special characters will be ignored while loading subgraph
      Returns:
      this loader
    • queryPgql

      public R queryPgql(String query)
      Adds another filtering query to the list of queries that will be executed to load the subgraph. The query has to be starting at the first MATCH pattern (e.g. MATCH (u)-[e]->(v) WHERE ...).
      Parameters:
      query - the PGQL query to use for filtering
      Returns:
      this loader
    • preparedPgqlQuery

      public abstract P preparedPgqlQuery(String query)
      Adds a prepared query to list of queries that will be executed to load the subgraph. The query has to also start with a MATCH clause. This returns a builder which can be used to specify arguments for the prepared query. All the arguments must be provided before the reading operation is triggered.
      Parameters:
      query - The PGQL query.
      Returns:
      A builder used for providing arguments of the prepared query.
    • loadAsync

      public PgxFuture<PgxGraph> loadAsync()
      Description copied from class: AbstractSubgraphReader
      Load the subgraph.
      Overrides:
      loadAsync in class AbstractSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>>
      Returns:
      The subgraph.
    • loadAsync

      public PgxFuture<PgxGraph> loadAsync(String graphName)
      Description copied from class: AbstractSubgraphReader
      Load the subgraph.
      Specified by:
      loadAsync in class AbstractSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>>
      Parameters:
      graphName - the name of the graph
      Returns:
      The subgraph.