Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. match (m)-[r]-() delete r
  2. match (m) delete m
  3.  
  4. match (m) return m
  5.  
  6. MATCH (a)-[*0..]-(b)
  7. WITH DISTINCT a, collect(DISTINCT b) AS sets
  8. RETURN DISTINCT sets
  9.  
  10. GOOGLE_APPLICATION_CREDENTIALS=d:\hackathon\google-api-key.json
  11. http://localhost:7474/service/mazerunner/analysis/connected_components/HAS_KEYWORD
  12.  
  13. curl -H "Content-Type: application/json" -X POST -d '{"password":"123456"}' -u neo4j:neo4j http://brainstash-db.northeurope.cloudapp.azure.com:7474/user/neo4j/password
  14.  
  15.  
  16. @Bean
  17. CommandLineRunner commandLineRunner(NeuronService neuronService) {
  18. return __ -> {
  19.  
  20. List<Keyword> tags1 = Arrays.asList(new Keyword("cool"), new Keyword("java"),
  21. new Keyword("c#"), new Keyword("awesome"));
  22. List<Keyword> tags2 = Arrays.asList(new Keyword("cooking"), new Keyword("chicken"),
  23. new Keyword("food"));
  24.  
  25. for (int i = 0; i < 100; i++) {
  26. Neuron neuron = new Neuron();
  27. neuron.setTitle("TITLE #" + i);
  28. Collections.shuffle(tags1);
  29. neuron.setKeywords(tags1.subList(0, tags1.size() - 2));
  30. neuronService.createNeuron(neuron);
  31.  
  32. }
  33. for (int i = 0; i < 30; i++) {
  34. Neuron neuron = new Neuron();
  35. neuron.setTitle("COOKING #" + i);
  36. Collections.shuffle(tags2);
  37. neuron.setKeywords(tags2.subList(0, tags2.size() - 1));
  38. neuronService.createNeuron(neuron);
  39.  
  40. }
  41.  
  42.  
  43. };
  44. }
  45.  
  46. @Bean
  47. CommandLineRunner commandLineRunner(UserService userService, NeuronRepository neuronRepository) {
  48. return __ -> {
  49. User newUser = new User("brainstash@gmail.com");
  50. List<Neuron> all = Lists.newArrayList(neuronRepository.findAll().iterator());
  51. newUser.setNeurons(all);
  52. userService.createUser(newUser);
  53. };
  54. }
  55.  
  56.  
  57. @Bean
  58. CommandLineRunner commandLineRunner(NeuronService neuronService, UserService userService, NeuronRepository neuronRepository) {
  59. return __ -> {
  60.  
  61. User newUser = new User("brainstash@gmail.com");
  62. List<Neuron> all = Lists.newArrayList(neuronRepository.findAll().iterator());
  63. newUser.setNeurons(all);
  64. User createdUser = userService.createUser(newUser);
  65.  
  66.  
  67. List<Keyword> tags1 = Arrays.asList(new Keyword("cool"), new Keyword("java"),
  68. new Keyword("c#"), new Keyword("awesome"));
  69. List<Keyword> tags2 = Arrays.asList(new Keyword("cooking"), new Keyword("chicken"),
  70. new Keyword("food"));
  71.  
  72. for (int i = 0; i < 100; i++) {
  73. Neuron neuron = new Neuron();
  74. neuron.setTitle("TITLE #" + i);
  75. Collections.shuffle(tags1);
  76. neuron.setKeywords(tags1.subList(0, tags1.size() - 2));
  77. neuronService.createNeuronForUser(neuron, createdUser);
  78.  
  79. }
  80. for (int i = 0; i < 30; i++) {
  81. Neuron neuron = new Neuron();
  82. neuron.setTitle("COOKING #" + i);
  83. Collections.shuffle(tags2);
  84. neuron.setKeywords(tags2.subList(0, tags2.size() - 1));
  85. neuronService.createNeuronForUser(neuron, createdUser);
  86. }
  87.  
  88.  
  89. User byEmail = userService.findByEmail("brainstash@gmail.com");
  90. System.out.println(byEmail.getNeurons());
  91.  
  92.  
  93. };
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement