Exceptions

mogwai.connection.execute_query(*args, **kwargs)

Execute a raw Gremlin query with the given parameters passed in.

Parameters:
  • query (str) – The Gremlin query to be executed
  • params (dict) – Parameters to the Gremlin query
  • connection (RexPro(Sync|Gevent|Eventlet)Connection or None) – The RexPro connection to execute the query with
  • context – String context data to include with the query for stats logging
Return type:

dict

mogwai.connection.generate_spec()

Generates a titan index and type specification document based on loaded Vertex and Edge models

mogwai.connection.get_response(query, params, isolate, transaction, connection, connection_pool)
mogwai.connection.pop_execute_query_kwargs(keyword_arguments)

pop the optional execute query arguments from arbitrary kwargs; return non-None query kwargs in a dict

mogwai.connection.setup(host, graph_name=u'graph', graph_obj_name=u'g', username=u'', password=u'', metric_reporters=None, pool_size=10, concurrency=u'sync')

Sets up the connection, and instantiates the models

mogwai.connection.sync_spec(filename, host, graph_name=u'graph', graph_obj_name=u'g', username=u'', password=u'', dry_run=False)

Sync the given spec file to mogwai.

Parameters:
  • filename (str) – The filename of the spec file
  • host (str) – The host the be synced
  • graph_name (str) – The name of the graph to be synced
  • dry_run (boolean) – Only prints generated Gremlin if True
Returns:

None