Examples of GremlinScriptEngine


Examples of com.tinkerpop.gremlin.GremlinScriptEngine

    public static ScriptEngine createGremlinScriptEngine()
    {
        try
        {
            ScriptEngine engine = new GremlinScriptEngine();

            // Inject the local database
            TransactionalGraph graph = getGremlinWrappedGraph();

            engine.getBindings( ScriptContext.ENGINE_SCOPE ).put( "$_g", graph );

            try
            {
                engine.getBindings( ScriptContext.ENGINE_SCOPE ).put( "$_",
                        graph.getVertex( 0l ) );
            }
            catch ( Exception e )
            {
                // Om-nom-nom
View Full Code Here

Examples of com.tinkerpop.gremlin.jsr223.GremlinScriptEngine

    final ODocument document = (ODocument) iCurrentRecord;

    if (engine == null) {
      try {
        engine = new GremlinScriptEngine();
      } catch (Throwable e) {
        throw new OConfigurationException("Error on loading Gremlin engine", e);
      }

      // TODO THIS COULD BE IMPROVED BY CREATING A ORIENT-GRAPH POOL (LIKE WITH OTHER DB TYPES) INSTEAD TO CREATE IT PER QUERY
View Full Code Here

Examples of com.tinkerpop.gremlin.jsr223.GremlinScriptEngine

  private OrientGraph    graph;

  @SuppressWarnings("unchecked")
  @Override
  public <RET extends OCommandExecutor> RET parse(OCommandRequestText iRequest) {
    engine = new GremlinScriptEngine();
    graph = new OrientGraph(iRequest.getDatabase().getURL());
    text = iRequest.getText();

    engine.getBindings(ScriptContext.ENGINE_SCOPE).put("g", graph);
    return (RET) this;
View Full Code Here

Examples of com.tinkerpop.gremlin.jsr223.GremlinScriptEngine

      return null;

    final ODocument document = (ODocument) iCurrentRecord;

    if (engine == null) {
      engine = new GremlinScriptEngine();
      graph = new OrientGraph(iCurrentRecord.getDatabase().getURL());
      engine.getBindings(ScriptContext.ENGINE_SCOPE).put("g", graph);
    }

    final OrientElement graphElement;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.