Amazon Neptune

Amazon Neptune#

Amazon Neptune is a managed graph database by Amazon. It supports OpenCypher, RDF, Gremlin, and various analytical capabilities.

class graphistry.gremlin.NeptuneMixin(*args, **kwargs)#

Bases: object

neptune(NEPTUNE_READER_HOST=None, NEPTUNE_READER_PORT=None, NEPTUNE_READER_PROTOCOL=None, endpoint=None, gremlin_client=None)#

Provide credentials as arguments, as environment variables, or by providing a gremlinpython client Environment variable names are the same as the constructor argument names If endpoint provided, do not need host/port/protocol If no client provided, create (connect)

Example: Login and plot via parrams

import graphistry
(graphistry
    .neptune(
        NEPTUNE_READER_PROTOCOL='wss'
        NEPTUNE_READER_HOST='neptunedbcluster-xyz.cluster-ro-abc.us-east-1.neptune.amazonaws.com'
        NEPTUNE_READER_PORT='8182'
    )
    .gremlin('g.E().sample(10)')
    .fetch_nodes()  # Fetch properties for nodes
    .plot())

Example: Login and plot via env vars

import graphistry
(graphistry
    .neptune()
    .gremlin('g.E().sample(10)')
    .fetch_nodes()  # Fetch properties for nodes
    .plot())

Example: Login and plot via endpoint

import graphistry
(graphistry
    .neptune(endpoint='wss://neptunedbcluster-xyz.cluster-ro-abc.us-east-1.neptune.amazonaws.com:8182/gremlin')
    .gremlin('g.E().sample(10)')
    .fetch_nodes()  # Fetch properties for nodes
    .plot())

Example: Login and plot via client

import graphistry
(graphistry
    .neptune(gremlin_client=client)
    .gremlin('g.E().sample(10)')
    .fetch_nodes()  # Fetch properties for nodes
    .plot())
Parameters:
  • NEPTUNE_READER_HOST (str | None)

  • NEPTUNE_READER_PORT (str | None)

  • NEPTUNE_READER_PROTOCOL (str | None)

  • endpoint (str | None)

  • gremlin_client (Any | None)