jbjares2

Untitled

Sep 24th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. File folder = new File(fileStr);
  2. for(File file: folder.listFiles()) {
  3. if(file.getName().contains(".DS_Store")) {
  4. continue;
  5. }
  6.  
  7. br = new BufferedReader(new FileReader(file));
  8. int numberOfRows = 1;
  9. while ((line = br.readLine()) != null) {
  10. // use comma as separator
  11. String[] siri = line.split(cvsSplitBy);
  12. StringBuilder insert = new StringBuilder();
  13. int i = 0;
  14. Driver driver = GraphDatabase.driver( "bolt://xxx.xxx.xxx.xxx:7687",AuthTokens.basic( "neo4j", "xxx" ) );
  15. //Driver driver = GraphDatabase.driver( "bolt://localhost:7687");
  16. Session session = driver.session();
  17. System.out.println("loading..");
  18.  
  19. // session.run("USING PERIODIC COMMIT\n" +
  20. // "LOAD CSV FROM "+"\"file://"+file.getPath()+"\" AS line\n" +
  21. // "CREATE (:Journey)");
  22.  
  23. StringBuilder sb = new StringBuilder();
  24. sb.append("USING PERIODIC COMMIT ");
  25. sb.append("LOAD CSV FROM "+"\"file:///"+file.getName()+"\" AS line ");
  26. sb.append("CREATE (a:Journey {");
  27. sb.append(SIRI_ONTOLOGY.EPOCH+": line[1] ,");
Advertisement
Add Comment
Please, Sign In to add comment