cypher

How to access Neo4j dataset through Javascript?

允我心安 提交于 2019-12-12 22:18:50
问题 I am wondering how I get access to my (example)dataset that I have on Neo4j through Javascript, i.e. I have a movie dataset, so I would like to get and receive queries through an local html page? As you might wonder, I am a very beginner to this and I really appreciate it if someone would explain it to me step by step :) Thanks in advance 回答1: You can access your Neo4j graph database through the http transactional endpoint http://neo4j.com/docs/stable/rest-api-transactional.html and issue

Reliable (auto)incrementing identifiers for all nodes/relationships in Neo4j

穿精又带淫゛_ 提交于 2019-12-12 22:09:29
问题 I'm looking for a way to generate unique identifiers for all my nodes/relationships in Neo4j, based on an incrementing counter (not big long uuids). The internal ids maintained by the Neo4j engine are known not to be reliable as outside references. A solution that comes close is the code proposed in this question, but it doesn't work when a single CREATE clause creates multiple new nodes: // get unique id MERGE (id:UniqueId{name:'Person'}) ON CREATE SET id.count = 1 ON MATCH SET id.count = id

Slow results retrieval from Cypher query in Java - Neo4j 2.0

巧了我就是萌 提交于 2019-12-12 21:24:33
问题 I'm experiencing surprisingly slow retrieval of results with ResourceIterator<Node> when I get results from Cypher query execution in Java. next() command takes on average 156ms, with standard deviation of 385! Is this behavior expected, or am I doing something wrong? Can anybody suggest a more efficient way of achieving the same thing? Graph structure I have the following graph layout, where Point nodes have LinksTo relations to other points: Node:Point Properties: - idPoint (new style

How do you create self-referential nodes?

邮差的信 提交于 2019-12-12 21:11:48
问题 ... or is it possible at all to create a node in Neo4j which has a relationship with itself (a simple loop-node)? If so, what would be the corresponding Cypher query? 回答1: The following query creates Peter who voted for himself. MERGE (peter:User { name: "Peter" }) MERGE (peter)<-[:VOTED_FOR]-(peter) RETURN peter 来源: https://stackoverflow.com/questions/22185212/how-do-you-create-self-referential-nodes

Finding Specific Path in Neo4j Quickly

冷暖自知 提交于 2019-12-12 19:16:15
问题 I've recently asked about how to find all paths between two types os nodes in a way where all the edges in the path had the same attribute (like the same ID). This would be something like: MATCH (a {type: 'cin1'})-[rels:Next*1.. {value: 1}]->(b {type: 'cancer'}) RETURN (a), (b) where instead of having value: 1 I would have value: same for all edges . I found a way to solve this by using something like this (as answered in my other question): MATCH (a:Label {type: 'cin1'}) MATCH (b:Label {type

Neo4j node property comparison during traversal

那年仲夏 提交于 2019-12-12 18:19:05
问题 I am completely new to Neo4j. I am testing the graph database and I have the following simple graph test-structure: different labeled nodes with properties, which are connected. All the nodes have a property, which is called access. It is a list of string elements such as: {access: ['http', 'www']} I'm searching for a solution, where I get all nodes from a starting node which are connected (doesn't matter which type or direction) and their relationship where an intersection on the access

How do I add a second label to a node in Spring Data Neo4J 3.0.0 (Release)?

こ雲淡風輕ζ 提交于 2019-12-12 15:36:31
问题 In Neo4J I have a @NodeEntity Person . I'd like to be able to also add additional labels such as :USER , :CUSTOMER , :OWNER , :AGENT , etc. It seems that spring-data-neo4j:3.0.0-RELEASE has support for an @Labels annotation, but I get a NullPointerException when trying to use it. @NodeEntity public class Person { @GraphId Long id @Indexed(unique=true) String email @Labels // <- Seems this is unsupported. private Collection<String>labels public void addLabel(String label) { this.labels.add

How to ask Neo4j to take cycles into account

≡放荡痞女 提交于 2019-12-12 15:22:42
问题 It seems Neo4j intentionally omits cycles so a query like: MATCH (n1)-[:R]->(n2)<-[:R]-(n1) RETURN n1, n2; Always returns nothing unless there are two relations with type R between n1 and n2 (which is absolutely possible and a bad hack). But I have a scenario in which this cycle might happen and it's desired: MATCH (n1)-[:R]->(n2)<-[:R]-(n3) RETURN n1, n2, n3; In this query, n1 and n3 might be the same node or different ones and it all depends on the data (both are valid). One way to

Neo4j Index creation fails

房东的猫 提交于 2019-12-12 15:08:20
问题 I am currently getting to know Neo4j and the abilities of a graph database. I also did the movie tutorial that comes with neo4j. Now I have to work on a big database (~135 GB, 500 mio. nodes, 950 mio. relationships) and want to add an index for a special type of nodes. This type of nodes, called Transaction, has a property called txid, which is a hash and looks like this: a56e849c19dfecbe93c9e8bfca8e6df0902775c9ecc2e082eea80436c3d93a51 I try to add the index with the cypher query: CREATE

Neo4j Unmanaged Extension and GuardTimeoutException

百般思念 提交于 2019-12-12 14:27:37
问题 I am in great need of some advice regarding an issue I'm running into with a Neo4j unmanaged extension that I'm building in Java. I have created a very simple code sample that highlights my issue. The basic premise is that I'd like to set the org.neo4j.server.webserver.limit.executiontime for the neo4j server to a reasonable amount of time for user queries (lets say 2 minutes) which are coming in through Cypher, other endpoints, etc. But I also have some batch jobs that I need to run through