Goblin API¶
Subpackages¶
Submodules¶
goblin.connection module¶
-
goblin.connection.
execute_query
(query, bindings=None, pool=None, future_class=None, graph_name=None, traversal_source=None, username='', password='', handler=None, request_id=None, *args, **kwargs)[source]¶ Execute a raw Gremlin query with the given parameters passed in.
Parameters: - query (str) – The Gremlin query to be executed
- bindings (dict) – Bindings for the Gremlin query
- pool (gremlinclient.pool.Pool) – Pool that provides connection used in query
- graph_name (str) – graph name as defined in server configuration. Defaults to “graph”
- traversal_source (str) – traversal source name as defined in the server configuration. Defaults to “g”
- username (str) – username as defined in the Tinkerpop credentials graph.
- password (str) – password for username as definined in the Tinkerpop credentials graph
- handler (func) – Handles preprocessing of query results
Returns: Future
-
goblin.connection.
pop_execute_query_kwargs
(keyword_arguments)[source]¶ pop the optional execute query arguments from arbitrary kwargs; return non-None query kwargs in a dict
-
goblin.connection.
setup
(url, pool_class=None, graph_name='graph', traversal_source='g', username='', password='', pool_size=256, future_class=None, ssl_context=None, connector=None, loop=None)[source]¶ This function is responsible for instantiating the global variables that provide
goblin
connection configuration params.Parameters: - url (str) – url for the Gremlin Server. Expected format: (ws|wss)://username:password@hostname:port/
- pool_class (gremlinclient.pool.Pool) – Pool class used to create
global pool. If
None
trys to importtornado_client.Pool
, if this import fails, trys to importaiohttp_client.Pool
- graph_name (str) – graph name as defined in server configuration. Defaults to “graph”
- traversal_source (str) – traversal source name as defined in the server configuration. Defaults to “g”
- username (str) – username as defined in the Tinkerpop credentials graph.
- password (str) – password for username as definined in the Tinkerpop credentials graph
- pool_size (int) – maximum number of connections allowed by global connection pool_size
- future (class) – type of Future. typically -
asyncio.Future
,trollius.Future
, ortornado.concurrent.Future
- ssl_context (ssl.SSLContext) –
ssl.SSLContext
for secure protocol - connector – connector used to establish
gremlinclient
connection. Overides ssl_context param. - loop – io loop.
goblin.constants module¶
goblin.exceptions module¶
-
exception
goblin.exceptions.
ElementDefinitionException
[source]¶ Bases:
goblin.exceptions.GoblinException
Error in element definition
-
exception
goblin.exceptions.
GoblinBlueprintsWrapperException
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a Blueprints wrapper error occurs
-
exception
goblin.exceptions.
GoblinConnectionError
[source]¶ Bases:
goblin.exceptions.GoblinException
Problem connecting with Titan
-
exception
goblin.exceptions.
GoblinException
[source]¶ Bases:
Exception
Generic Base Exception for Goblin Library
-
exception
goblin.exceptions.
GoblinGraphMissingError
[source]¶ Bases:
goblin.exceptions.GoblinException
Graph with specified name does not exist
-
exception
goblin.exceptions.
GoblinGremlinException
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a Gremlin error occurs
-
exception
goblin.exceptions.
GoblinMetricsException
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a metric system error occurs
-
exception
goblin.exceptions.
GoblinQueryError
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a query error occurs
-
exception
goblin.exceptions.
GoblinRelationshipException
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a Relationship error occurs
-
exception
goblin.exceptions.
ModelException
[source]¶ Bases:
goblin.exceptions.GoblinException
Error in model
-
exception
goblin.exceptions.
SaveStrategyException
[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a Save Strategy error occurs
-
exception
goblin.exceptions.
ValidationError
(*args, **kwargs)[source]¶ Bases:
goblin.exceptions.GoblinException
Exception thrown when a property value validation error occurs