Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File folder = new File(fileStr);
- for(File file: folder.listFiles()) {
- if(file.getName().contains(".DS_Store")) {
- continue;
- }
- br = new BufferedReader(new FileReader(file));
- int numberOfRows = 1;
- while ((line = br.readLine()) != null) {
- // use comma as separator
- String[] siri = line.split(cvsSplitBy);
- StringBuilder insert = new StringBuilder();
- int i = 0;
- Driver driver = GraphDatabase.driver( "bolt://xxx.xxx.xxx.xxx:7687",AuthTokens.basic( "neo4j", "xxx" ) );
- //Driver driver = GraphDatabase.driver( "bolt://localhost:7687");
- Session session = driver.session();
- System.out.println("loading..");
- // session.run("USING PERIODIC COMMIT\n" +
- // "LOAD CSV FROM "+"\"file://"+file.getPath()+"\" AS line\n" +
- // "CREATE (:Journey)");
- StringBuilder sb = new StringBuilder();
- sb.append("USING PERIODIC COMMIT ");
- sb.append("LOAD CSV FROM "+"\"file:///"+file.getName()+"\" AS line ");
- sb.append("CREATE (a:Journey {");
- sb.append(SIRI_ONTOLOGY.EPOCH+": line[1] ,");
Advertisement
Add Comment
Please, Sign In to add comment