neo4j

Delete old nodes and relationships with Cypher in Neo4j 1.9

二次信任 提交于 2019-12-11 04:18:10
问题 I am using Neo4j 1.9 M03 in HA mode, my challenge is to remove all nodes and relationships as well as indices that are older than a certain date. For this I created a property for nodes and relationships. The property is a datestamp in the "YYMMDD" format. I'm trying to use the following Cypher query to perform the operation mentioned above: START n0=node(0), nx=node(*) MATCH n0-[r0?]-(), nx-[rx?]-() WHERE nx <> n0 AND HAS (nx.datestamp) AND nx.datestamp <= yyyymmdd OR HAS (rx.datestamp) AND

Transactions and relationship entities mapping problems with Neo4j OGM

痞子三分冷 提交于 2019-12-11 04:13:06
问题 Versions used: spring-data-neo4j 4.2.0-BUILD-SNAPSHOT / neo4j-ogm 2.0.6-SNAPSHOT I'm having problems to correctly fetch relationship entities . The following fetch calls don't return consistent results (executed in the same transaction): session.query("MATCH (:A)-[b:HAS_B]-(:C) RETURN count(b) as count") returns 1 session.query("MATCH (:A)-[b:HAS_B]-(:C) RETURN b") correctly returns the relationship entity as a RelationshipModel object session.query(B.class, "MATCH (:A)-[b:HAS_B]-(:C) RETURN

how to cluster users based on tags

穿精又带淫゛_ 提交于 2019-12-11 04:11:51
问题 I'd like to cluster users based on the categories or tags of shows they watch. What's the easiest/best algorithm to do this? Assuming I have around 20,000 tags and several million watch events I can use as signals, is there an algorithm I can implement using say pig/hadoop/mortar or perhaps on neo4j? In terms of data I have users, programs they've watched, and the tags that a program has (usually around 10 tags per program). I would like to expect at the end k number of clusters (maybe a

Neo4j: Inserting 7k nodes is slow (Spring Data Neo4j / SpringRestGraphDatabase)

坚强是说给别人听的谎言 提交于 2019-12-11 04:04:55
问题 I'm building an application where my users can manage dictionaries. One feature is uploading a file to initialize or update the dictionary's content. The part of the structure I'm focusing on for a start is Dictionary -[:CONTAINS]->Word . Starting from an empty database (Neo4j 1.9.4, but also tried 2.0.0M5), accessed via Spring Data Neo4j 2.3.1 in a distributed environment (therefore using SpringRestGraphDatabase, but testing with localhost), I'm trying to load 7k words in 1 dictionary.

Neo4j & JPype Installation Issue

若如初见. 提交于 2019-12-11 03:59:24
问题 I use Ubuntu 10.10 and before continuing with the installation, I installed JPype and openjdk-6-jdk & all its dependencies using synaptic. I proceeded with the install of Neo4j & Python as mentioned on: http://components.neo4j.org/neo4j.py/0.1-SNAPSHOT/ But when I did sudo python setup.py install in the neo4j-python folder, it gave the following error output Traceback (most recent call last): File "setup.py", line 146, in <module> main() File "setup.py", line 134, in main args[attr] = pom

How to generate relationships using property information [Node4j]

不问归期 提交于 2019-12-11 03:56:52
问题 I have imported a CSV where each Node contains 3 columns. id, parent_id, and title. This is a simple tree structure i had in mysql. Now i need to create the relationships between those nodes considering the parent_id data. So each node to node will have 2 relationships as parent and child. Im really new to node4j and suggestions ? i tried following, but no luck MATCH (b:Branch {id}), (bb:Branch {parent_id}) CREATE (b)-[:PARENT]->(bb) 回答1: It seems as though your cypher is very close. The

Performing a MATCH on all nodes on a path

我只是一个虾纸丫 提交于 2019-12-11 03:55:38
问题 Is it somehow possible to use a MATCH pattern inside the ALL function (using v1.8)? What I am trying to do is the following: I am MATCH ing a path p = (a)-->(b)-->(c)-->(d) . However, all nodes along this path must have an additional incoming relationship r from some node. Let me try to make this clear in ASCII: (a)-->(b)-->(c)-->(d) ^ ^ ^ |r |r |r ( ) ( ) ( ) Can I somehow use the ALL function for that or do I have to add additional MATCH patterns like this: START ... MATCH (a)-->(b)-->(c)--

Parameter maps cannot be used in MERGE patterns

北慕城南 提交于 2019-12-11 03:55:24
问题 I am getting error Parameter maps cannot be used in MERGE patterns .How can I resolve this error.I am using the code below .I really appreciate any help.Thanks in Advance. 'MERGE (u:Person {names}) RETURN u '; and $data2='{ "names" : [{ "name" : "Keanu Reeves1", "role" : "Neo1" }, { "name" : "Keanu Reeves2", "role" : "Neo2" }, { "name" : "Keanu Reeves3", "role" : "Neo3" }] }'; Entire code : <?php $data2='{ "names" : [{ "name" : "Keanu Reeves1", "role" : "Neo1" }, { "name" : "Keanu Reeves2",

How to extend Relationship class in neo4django

99封情书 提交于 2019-12-11 03:55:14
问题 I've seen that relationship properties are not yet implemented in neo4django. The workaround exposed in this thread is to have a new node type for each relationship with a property. I can't afford too much calculations so I don't want to use this technique. While reading the source code I've seen, as the docstring of the Relationship class, this : """Extend to add properties to relationships.""" My question is, how to do that ? Where to start to add at least one property ? Thanks 回答1: Despite

Entity is not an instance of a persistable class NEO4J 4.0.0

不问归期 提交于 2019-12-11 03:53:09
问题 Spring data neo4j 4.0.0 Release In spring mvc project i am trying to save a node by repository.save() method i am getting error. @NodeEntity public class Category { @GraphId public Long id; public String categoryName; public Category() { } public Category( Long id, String categoryName ) { this.id = id; this.categoryName = categoryName; } } @Configuration @EnableNeo4jRepositories("org.neo4j.example.northwind.repository") @EnableTransactionManagement public class AppContext extends