neo4j

Neo4j spark connector loadDataFrame gives error

江枫思渺然 提交于 2019-12-11 16:39:31
问题 EDIT: Tried to do what was suggested in the comments with .toDF got this error: ^ neo: org.neo4j.spark.Neo4j = org.neo4j.spark.Neo4j@5dfb65d5 warning: there was one deprecation warning; re-run with -deprecation for details sqlContext: org.apache.spark.sql.SQLContext = org.apache.spark.sql.SQLContext@333e01c6 import sqlContext.implicits._ rdd: org.apache.spark.rdd.RDD[org.apache.spark.sql.Row] = Neo4jRDD partitions Partitions(1,9223372036854775807,9223372036854775807,None) call spatial

Match on shortest distance with aggregation function min() in Cypher

和自甴很熟 提交于 2019-12-11 16:28:20
问题 I have Station nodes, and Neighborhood nodes. They both have a location attribute which is of type point of the spatial data type. I need to create a relationship between the nodes (a Station belongs to the closest neighborhood). Therefore, I should only get one row per station. However, my query gives back all combinations as a result. MATCH (n:Neighborhood),(s:Station) WITH n, s, min(distance(n.centerLocation, s.point)) AS shortest WHERE distance(n.centerLocation, s.point) = shortest RETURN

Neo4j cypher query performance via REST on centered nodes

谁说胖子不能爱 提交于 2019-12-11 16:22:45
问题 I'm still pretty new to neo4j. I've written a small RESTFUL service which inserts nodes to a neo4j db (server) via REST as a PoC. The structure looks this way: root - [NODES] -> n -> [NODE] -> node The n node is the one that is "centered". I planned to add other centered node as different node types (e.g. products/categories/documents/attributes/users ...) In my first example i added approx. 1.000 nodes. Now i tried to increase the aount of nodes and query for that nodes. Now i'm facing a

Cannot find node using graphDatabaseService when it is created in the same test

风流意气都作罢 提交于 2019-12-11 16:21:10
问题 as continuation of Trying out neo4j grails plugin, but it does not mach the docs I have a test now looks like this: package com.iibs.graph import groovy.util.GroovyTestCase import com.iibs.graph.Node public class NodeTests extends GroovyTestCase { def graphDatabaseService void testCRUD() { Node.deleteAll(Node.list()) Node node = new Node(name: "Name") node.save(flush: true, failOnError: true) Node found = Node.findByName("Name") assert found instanceof Node assert found.getName() == "Name"

Unable to use two Neo4j Instances with Spring boot/Spring data neo4j

人盡茶涼 提交于 2019-12-11 16:05:41
问题 Expected Behavior Trying to use two Neo4j instances with Spring boot and Spring data Neo4j Current Behavior Able to use only one Neo4j instances. Unable to use two repositories. Steps to Reproduce (for bugs) 1. Run two Neo4j Instances 2. Create Data source configuration for both Neo4j Instances using spring boot. 3. Use Repository to access the Node entity 4. It will throw error Context Consider that I am running a library and renting books to other users. If the user is renting the book from

/etc/init.d/ script file generating permission denied error

一曲冷凌霜 提交于 2019-12-11 15:51:30
问题 I have a local neo4j-community-3.5.6 directory with a database on an Ubuntu 16.04 virtual machine. I want to start this service at start-up so I created a neo4j script in /etc/init.d and sym-linked it to the directory /etc/rcS.d If the start-up script is like: ./home/my_user/custom_folder/neo4j-community-3.5.6/bin/neo4j start the service starts properly and I can access it from the local network. However, if I modify the default /etc/init.d script released by the neo4j community as follows: #

neo4j select nodes that have at least n relations

会有一股神秘感。 提交于 2019-12-11 15:47:38
问题 I'm trying to build a cypher query that select people that live in a city and countries that those cities belong to. this is what I have at them moment: MATCH (p:Person)-[r:LiveIn]-(city:City) WHERE s.name= "a" OR s.name= "b" OR ... MATCH (city)-[:IsIn]-(country:Country) RETURN city,country,person but what I really want to say is : "select cities that have atleast 5 of those people (p) liveIn them" I'm not quite sure how to tackle this. Any suggestions? 回答1: Try this one: MATCH (p:Person)-[r

You have defined query method in the repository but you don't have any query lookup strategy defined

心不动则不痛 提交于 2019-12-11 15:42:21
问题 Yesterday this solution was working fine. Today I woke up to rerun the tests & it failed stating in the stacktrace that You have defined query method in the repository but you don't have any query lookup strategy defined. The infrastructure apparently does not support query methods! at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.(RepositoryFactorySupport.java:533) As clearly shown I did not define any query methods. :-( I'm stuck, I

Neo4j: Link Different Nodes to the one node

不想你离开。 提交于 2019-12-11 15:42:12
问题 Let's say you have the following 4 nodes: Set 1: (act: "Event Log", timestamp: 3461000) (act: "Uptime Report", timestamp: 3461000) Set 2: (act: "Event Log", timestamp: 149100) (act: "Uptime Report", timestamp: 149100) I am trying to figure out how to map each set of nodes to one node. I tried the following Cypher but all 4 nodes are mapping to only one node, (a) instead of creating two (a) nodes and mapping the 2 sets respectively. Is it necessary to have a condition that looks for the

why allshortestpath so slow?

南楼画角 提交于 2019-12-11 15:27:36
问题 I create some graph database with python and neo4j library. Graph have 50k nodes and 100k relationships. How creating nodes: CREATE (user:user {task_id: %s, id: %s, root: 1, private: 0}) How creating relationships: MATCH (root_user), (friend_user) WHERE root_user.id = %s AND root_user.task_id = %s AND friend_user.id = %s AND friend_user.task_id = %s CREATE (root_user)-[r: FRIEND_OF]->(friend_user) RETURN root_user, friend_user How i search all path between nodes: MATCH (start_user:user {id: