Package com.tinkerpop.blueprints.pgm.impls.orientdb

Examples of com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph


  public static void main(final String[] args) throws Exception {
    final String inputFile = args.length > 0 ? args[0] : INPUT_FILE;
    final String dbURL = args.length > 1 ? args[1] : DBURL;

    OrientGraph g = new OrientGraph(dbURL);

    System.out.println("Importing graph from file '" + inputFile + "' into database: " + g + "...");

    final long startTime = System.currentTimeMillis();

    g.setTransactionMode(Mode.MANUAL);

    GraphMLReader.inputGraph(g, new FileInputStream(inputFile), 100000, null, null, null);
    g.shutdown();

    System.out.println("Imported in " + (System.currentTimeMillis() - startTime) + "ms. Vertexes: "
        + g.getRawGraph().countVertexes() + " Edges: " + g.getRawGraph().countEdges());

  }
View Full Code Here


      } 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
      graph = new OrientGraph(iCurrentRecord.getDatabase().getURL());
      engine.getBindings(ScriptContext.ENGINE_SCOPE).put("g", graph);
    }

    final OrientElement graphElement;
View Full Code Here

  public static void main(final String[] args) throws Exception {
    final String inputFile = args.length > 0 ? args[0] : INPUT_FILE;
    final String dbURL = args.length > 1 ? args[1] : DBURL;

    OrientGraph g = new OrientGraph(dbURL);

    System.out.println("Importing graph from file '" + inputFile + "' into database: " + g + "...");

    final long startTime = System.currentTimeMillis();

    g.setTransactionMode(Mode.MANUAL);

    GraphMLReader.inputGraph(g, new FileInputStream(inputFile), 0, null, null, null);
    g.shutdown();

    System.out.println("Imported in " + (System.currentTimeMillis() - startTime) + "ms. Vertexes: "
        + g.getRawGraph().countVertexes() + " Edges: " + g.getRawGraph().countEdges());

  }
View Full Code Here

  @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

    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

Related Classes of com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph

Copyright © 2018 www.massapicom. 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.