neo4j

Neo4j: Sum relationship properties where node properties equal Value A and Value B (intersection)

断了今生、忘了曾经 提交于 2019-12-11 01:38:23
问题 Basically my question is: how do I sum relationship properties where there is a related nodes that have properties equal to Value A and Value B? For example: I have a simple DB has the following relationship: (site)-[:HAS_MEMBER]->(user)-[:POSTED]->(status)-[:TAGGED_WITH]->(tag) On [:TAGGED_WITH] I have a property called "TimeSpent". I can easily SUM up all the time spent for a particular day and user by using the following query: MATCH (user)-[:POSTED]->(updates)-[r:TAGGED_WITH]->(tags)

How to do nested queries in neo4j

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 01:33:18
问题 Can't figure out how to do this in a good way in neo4j, so please help me. I have Three types of objects: Person, Object, Opinion. I want to get a list of the latest opinions, the person who had the opinion, the object. This I can do, it's not difficult. My problem starts when I want to get the people that has opinions about the same objects in the same query. This is the result I would like to have: Person: Berit, Object: cerials, Opinion: good Person: Arne, Object: cerials, Opinion: good

neo4j constraint deleted node

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 01:33:02
问题 I have an issue where a constraint exception is thrown on a deleted node. The cypher statement "match (n) where ID(n)=272 return ID(n),n" returns 0 rows, but when I try to create a new record that previously had a constrained value, the exception below) is still throw. FYI, the constraint is on a property containing a String[] - maybe constraint uniqueness is broken with arrays? Working with NEO4J 2.0.0M06 using the Java API (OpenJDK 7) on Ubuntu 12.04 via the nodejs/java npm (v sweet combo:)

Neo4j Rest Read timed out exception

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 01:28:16
问题 Using Neo4j 1.9 in REST mode and Spring Data for neo4j .. while performing load test on my app I am getting the exception below... com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131) at org.neo4j.rest.graphdb.UserAgent$1.handle(UserAgent.java:68) at com.sun.jersey.api.client.Client.handle(Client.java:616) at com.sun.jersey.api.client

Querying Recursive Relationship Chains in Neo4j with Cypher

孤街浪徒 提交于 2019-12-11 01:25:52
问题 I have a graph database that is modeling the metadata for messages and the fields that can be contained on those messages. Some of those fields can be "groups" which are groups of other fields. What I am attempting to ask Neo is "what messages are using this group?". The following is a list of the path types that can be used to get from a message to a group: message-[:INLINE]->group (the fields of a group are used inline on a message) message-[:FIELDREF]->(fref)-[:FIELD]->(field)-[:DATATYPE]-

Beginner in Cypher: List actors that acted in all 3 Matrix movies

点点圈 提交于 2019-12-11 01:16:21
问题 I started learning Neo4j last friday. I've completed the Cypher examples on my local database, are there are some additional queries that I'd like to learn how to ask: Given the three matrix movies, how do I list only actors that acted in all three of them? Or more generally, suppose I have a bunch of movies, actors and ACTS_IN relationships. Given 3 movies: List all the actors that acted in ALL 3 List all the actors that acted in any of those 3 movies (and which movies they acted in)

Spatial cypher queries don't work

折月煮酒 提交于 2019-12-11 00:54:48
问题 I configured the spatial plugin for Neo4j with the following REST API Calls: POST http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer { "layer" : "geom", "lat" : "lat", "lon" : "lon" } POST http://localhost:7474/db/data/index/node/ { "name" : "geom", "config" : { "provider" : "spatial", "geometry_type" : "point", "lat" : "lat", "lon" : "lon" } } I add spatial nodes with the following Scala code (embedded in a Play application): val mergeStatement = Cypher( """ MERGE

Python and graph database. Use java lib wrapper or REST api?

别说谁变了你拦得住时间么 提交于 2019-12-11 00:34:42
问题 I want to ask you about the best way to use graph database (Neo4j) in Python. What you think, should I use "neo4j/python-embedded" (neo4j/python-embedded with JPype) or maybe "bulbflow" (bulbflow, with Rexster, Gremlin and REST api)? Is REST api secure and provides high availability (e.g. 500 000+ users)? Thank you. 回答1: I think Bulbs against Neo4j Server might be the best combination. Also, you can set up Neo4j in High Availability mode so multiple instances are forming a cluster, http:/

Neo4j Merge and Atomic Transaction

。_饼干妹妹 提交于 2019-12-10 23:49:24
问题 I am running the below MERGE query against my Neo4j server from a client application in 10 parallel threads, the newFoo and id parameters are the same on all 10 runs: MERGE (foo:Foo { id: {id} }) ON MATCH SET foo = {newFoo} After running this, I run the below query to expect 1 but I instead get 10 : match (f:Foo) return count(f) I thought that MERGE runs in an atomic transaction but apparently not. Am I doing something wrong here? Update Below is the code that I used to reproduce the issue:

How to Load Cypher File into Neo4j

…衆ロ難τιáo~ 提交于 2019-12-10 23:32:51
问题 I have generated a cypher file and want to load it into neo4j. The only relevant documentation I could find was about loading csv's. I also tried the shell but it seems to have no effect cypher-shell.bat -uneo4j -pne04j < db.cql Copy paste into localhost:7474/browser makes the browser unresponsive. 回答1: In the current Neo4j version you can use Cypher Shell to achieve your goal. From the docs, Invoke Cypher Shell with a Cypher script from the command line: $ cat db.cql | bin/cypher-shell -u