Package org.neo4j.graphdb.factory

Examples of org.neo4j.graphdb.factory.GraphDatabaseFactory


      setBasePackage(Neo4jWebTests.class.getPackage().getName());
    }

    @Bean(destroyMethod = "shutdown")
    public GraphDatabaseService graphDatabaseService() {
      return new GraphDatabaseFactory().newEmbeddedDatabase("target/graphdb");
    }
View Full Code Here


import java.util.Map;

public class EmbeddedGraphDatabase extends GraphDatabaseImpl{

  public EmbeddedGraphDatabase(String storeDir){
    super(new GraphDatabaseFactory().newEmbeddedDatabase(storeDir));
  }
View Full Code Here

  public EmbeddedGraphDatabase(String storeDir){
    super(new GraphDatabaseFactory().newEmbeddedDatabase(storeDir));
  }
 
  public EmbeddedGraphDatabase(String storeDir, Map<String,String> params){
    super(new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(storeDir).setConfig(params).newGraphDatabase());
  }
View Full Code Here

    @Override
    public Datastore<?, ?, ?> createDatastore(CdoUnit cdoUnit) {
        URL url = cdoUnit.getUrl();
        String protocol = url.getProtocol().toLowerCase();
        if ("file".equals(protocol)) {
            GraphDatabaseService graphDatabaseService = new GraphDatabaseFactory().newEmbeddedDatabase(url.getPath());
            return new EmbeddedNeo4jDatastore(graphDatabaseService);
        } else if ("http".equals(protocol) || "https".equals(protocol)) {
            return new RestNeo4jDatastore(url.toExternalForm());
        }
        return null;
View Full Code Here

        }

        private void switchToEmbeddedGraphDatabase()
        {
            shutdown();
            graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( dbPath.getAbsolutePath() );
        }
View Full Code Here

   */
  public static void main(String[] args) {
    if (args.length < 4) {
      System.out.println("Usage: osmtoshp databasedir exportdir osmdataset layerspec <..layerspecs..>");
    } else {
      GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase((new File(args[0])).getAbsolutePath());
      SpatialDatabaseService spatial = new SpatialDatabaseService(db);
      OSMLayer layer = (OSMLayer) spatial.getLayer(args[2]);
      if (layer != null) {
        ShapefileExporter exporter = new ShapefileExporter(db);
        exporter.setExportDir(args[1]+File.separator+layer.getName());
View Full Code Here

public class FileDatastoreFactory implements DatastoreFactory<EmbeddedNeo4jDatastore> {

    @Override
    public EmbeddedNeo4jDatastore createGraphDatabaseService(URI uri) throws MalformedURLException {
        GraphDatabaseService graphDatabaseService = new GraphDatabaseFactory().newEmbeddedDatabase(uri.toURL().getPath());
        registerShutdownHook(graphDatabaseService);
        return new EmbeddedNeo4jDatastore(graphDatabaseService);
    }
View Full Code Here

    }
  }

  @Override
  public GraphDatabaseService create() {
    GraphDatabaseBuilder builder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder( dbLocation );
    setConfigurationFromLocation( builder, configurationLocation );
    setConfigurationFromProperties( builder, configuration );
    return builder.newGraphDatabase();
  }
View Full Code Here

    @PostConstruct
    private void initDB() {
        try {
            Path tempDir = Files.createTempDirectory("test-neo4j");
            graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(tempDir.toString());
            try (Transaction tx = graphDb.beginTx()) {
                firstNode = graphDb.createNode();
                secondNode = graphDb.createNode();
                tx.success();
            }
View Full Code Here

  @Override
  public void initialize(final StructrConf config) {

    final String dbPath                = config.getProperty(Services.DATABASE_PATH);
    final GraphDatabaseBuilder builder = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath);

    logger.log(Level.INFO, "Initializing database ({0}) ...", dbPath);

    if (graphDb != null) {
View Full Code Here

TOP

Related Classes of org.neo4j.graphdb.factory.GraphDatabaseFactory

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.