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
goblinconnection 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
Nonetrys 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.SSLContextfor secure protocol - connector – connector used to establish
gremlinclientconnection. Overides ssl_context param. - loop – io loop.
goblin.constants module¶
goblin.exceptions module¶
-
exception
goblin.exceptions.ElementDefinitionException[source]¶ Bases:
goblin.exceptions.GoblinExceptionError in element definition
-
exception
goblin.exceptions.GoblinBlueprintsWrapperException[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a Blueprints wrapper error occurs
-
exception
goblin.exceptions.GoblinConnectionError[source]¶ Bases:
goblin.exceptions.GoblinExceptionProblem connecting with Titan
-
exception
goblin.exceptions.GoblinException[source]¶ Bases:
ExceptionGeneric Base Exception for Goblin Library
-
exception
goblin.exceptions.GoblinGraphMissingError[source]¶ Bases:
goblin.exceptions.GoblinExceptionGraph with specified name does not exist
-
exception
goblin.exceptions.GoblinGremlinException[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a Gremlin error occurs
-
exception
goblin.exceptions.GoblinMetricsException[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a metric system error occurs
-
exception
goblin.exceptions.GoblinQueryError[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a query error occurs
-
exception
goblin.exceptions.GoblinRelationshipException[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a Relationship error occurs
-
exception
goblin.exceptions.ModelException[source]¶ Bases:
goblin.exceptions.GoblinExceptionError in model
-
exception
goblin.exceptions.SaveStrategyException[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a Save Strategy error occurs
-
exception
goblin.exceptions.ValidationError(*args, **kwargs)[source]¶ Bases:
goblin.exceptions.GoblinExceptionException thrown when a property value validation error occurs