Examples of EmbeddedGraphDatabase


Examples of org.neo4j.kernel.EmbeddedGraphDatabase

 

  // URI index
  public static Index<Node> getUriIndex(ServletContext servletContext){
//    EmbeddedReadOnlyGraphDatabase graphDB = getReadOnlyGraphDatabase(servletContext);
    EmbeddedGraphDatabase graphDB = getGraphDatabase(servletContext);
    Index<Node> index = (Index<Node>)servletContext.getAttribute(URI_IDX);
    if (index == null){
      IOHelper.log("Adding uri index - " + URI_IDX + " - to servletContext");
      index = graphDB.index().forNodes(URI_IDX);
      ((LuceneIndex<Node>) index).setCacheCapacity(DBNodeProperties.URI, 300000);
      servletContext.setAttribute(URI_IDX,index);
    }
    return index;
  }
View Full Code Here

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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

    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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

   
  }

 
  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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

  /**
   * @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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

      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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

  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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

      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

Examples of org.neo4j.kernel.EmbeddedGraphDatabase

    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
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.