Package org.neo4j.kernel

Examples of org.neo4j.kernel.EmbeddedGraphDatabase


    db = db2;
    d = 0.85;
  }

  CalculatePageRank(String path) {
    db = new EmbeddedGraphDatabase(path);
    d = 0.85;
  }
View Full Code Here


    listUsers();
    shutdownDB();
  }

  private static void setupDB() {
    graphDB = new EmbeddedGraphDatabase(Config.get().neo4jDbPath);
   
    uriIndex = graphDB.index().forNodes(DBNodeProperties.URI_INDEX_NAME);
    ((LuceneIndex<Node>) uriIndex).setCacheCapacity(DBNodeProperties.URI, 300000);
  }
View Full Code Here

   
  }

 
  public static void main(String[] args) {
    graphDB = new EmbeddedGraphDatabase("myTestDb");
    index = graphDB.index().forNodes("custom5Index",
        MapUtil.stringMap( "analyzer", CustomTokenAnalyzer.class.getName() )
        );
   
   
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    EmbeddedGraphDatabase graphDB = new EmbeddedGraphDatabase(Config.get().neo4jDbPath);
   
    //CoAuthorCalculator cac = new CoAuthorCalculator(graphDB);
    //cac.calculateTopKCoAuthors(500,10);
    //cac.calculateTopKLikesToCiteAuthors(500, 12);

    //SimilarPaperCalculator spc = new SimilarPaperCalculator(graphDB);
    //spc.startTopKCalculation(500, 15);
    //spc.similarTopKAuthors(500, 15);
   
//    CalculatePageRank cpr = new CalculatePageRank(graphDB);
//    cpr.dcalculatePageRank(0.85, 3);
   
   
    BuildIndices bi = new BuildIndices();
    bi.setGraphDB(graphDB);
    bi.buildSearchIndex();
   
    graphDB.shutdown();
  }
View Full Code Here

* @author rpickhardt
*
*/
public class SimilarPaperCalculator extends Calculator {
  public SimilarPaperCalculator() {
    graphDB = new EmbeddedGraphDatabase(Config.get().neo4jDbPath);
  }
View Full Code Here

      IOHelper.log("Error saving to node: userNode not set.");
      print();
      return;
    }
   
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);

    Transaction tx = graphDB.beginTx();
    try{
      userNode.setProperty(DBNodeProperties.USER_EMAIL, email);
      userNode.setProperty(DBNodeProperties.USER_PW_HASH, passwordHash);
      userNode.setProperty(DBNodeProperties.USER_NAME, username);
      userNode.setProperty(DBNodeProperties.USER_SESSIONS, sessionList.toArray(new String[sessionList.size()]));
View Full Code Here

  private void createUserNode() {
    IOHelper.log("Creating new user");
    print();
   
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);
   
    Transaction tx = graphDB.beginTx();
    try{
      userNode = graphDB.createNode();
      save();
     
      tx.success();
    } catch (Exception e){
      tx.failure();
View Full Code Here

      tx.finish();
    }
  }
 
  private void deleteUser() {
    EmbeddedGraphDatabase graphDB = ContextHelper.getGraphDatabase(servletContext);
   
    Transaction tx = graphDB.beginTx();
    try{
      userNode.setProperty(DBNodeProperties.USER_DELETED, true);
      tx.success();
    } catch (Exception e){
      tx.failure();
View Full Code Here

    AbstractGraphDatabase database;
    if (config.getReadOnly()) {
      database = new EmbeddedReadOnlyGraphDatabase(
          config.getDatabasePath(), graphConfig);
    } else {
      database = new EmbeddedGraphDatabase(config.getDatabasePath(),
          graphConfig);
    }

    // load lucene indices
    DATABASE = database;
View Full Code Here

    private static enum RelTypes implements RelationshipType { NEXT }

    public ImportData() {
        // Create the graph db
        graphDb = new EmbeddedGraphDatabase("var/geo");
        // Wrap it as a spatial db service
        spatialDb = new SpatialDatabaseService(graphDb);
        // Create the layer to store our spatial data
        runningLayer = (EditableLayer) spatialDb.getOrCreateLayer("running", SimplePointEncoder.class, EditableLayerImpl.class, "lon:lat");
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.EmbeddedGraphDatabase

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.