spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » NEO4J » Page 1
neo4j ::how to set shortpath query timeout property in embedded model?
Direction.BOTH is an indication that it goes in circles. You MMIO settings should be much larger (closer to the file sizes), and your heap probably too (as it includes the mmio sections on Windows -> at least 12G to 16G heap). You didn't share the part of messages.log that gives indication about heap sizes. neostore.nodestore.db.mapped_memory=500M neostore.relationshipstore.db.mapped_memory=6

Categories : Neo4j

Neo4j-shell query result size in MB
Don't know a way to do this in Neo4j shell. However you can use a command line tool like curl using the option -w to emit the download size: curl -s -o /dev/null -H "Content-Type: application/json" -d '{"statements" : [ {"statement" : "Match (n:Person) return n limit 10"}]}' http://localhost:7474/db/data/transaction/commit -w "result size %{size_download} "

Categories : Neo4j

Neo4j values from WITH disappears if subsequent MATCH fails
I think something like this may do the trick. MATCH (u1:user {username: "pewpewlasers"}), (u2:user {username: "pewpew2"}) MERGE (u1)-[y:KNOWS]->(u2) ON CREATE SET y.connected = 1 WITH y, has(y.connected) AS connected REMOVE y.connected WITH y, connected OPTIONAL MATCH (x)-[zz:LIKES]->(yy) FOREACH(ignoreMe IN CASE WHEN yy IS null THEN [] ELSE [1] END | MERGE x-[:LOVES]->(yy)) WITH z

Categories : Neo4j

Neo4j: Recursive query for simple node structure
I think you mean something like this: // Mark the root (aka `e_bossid IS NULL`) MATCH (e:Employee) WHERE NOT (e)-[:REPORTS_TO]->() SET e:Root // find all paths of arbitrary length from he root MATCH path = (b:Root)<-[:REPORTS_TO*]-(e:Employee) RETURN path limit 1000

Categories : Neo4j

Return one result per person in neo4j
You can use a aggregation function in cypher: MATCH (p:Person)-[:RESULT]->(t) RETURN p, min(t.result) However this will not return a row for person not having a RESULT relationship. Using OPTIONAL MATCH can help with this.

Categories : Neo4j

Neo4j: Create slef relation cypher query
In order to create the relationship based on neo_eb_bossID, you can match the nodes and run a foreach loop that will create the relationships to the related node : MATCH (e:EmpBase) WITH collect(e) AS empbases FOREACH (emp in empbases | MERGE (target:EmpBase {neo_eb_id:emp.neo_eb_bossID} MERGE (emp)-[:YOUR_RELATIONSHIP]->(target) ) Concerning the self relationship, I've hard to under

Categories : Neo4j

py2neo 2.0: ERROR:httpstream:! SocketError: timed out
There's currently no way to adjust the timeout for individual queries as this setting applies at a connection level and one connection can obviously be used for many queries. The socket_timeout you're using is the correct way to adjust the timeout globally though.

Categories : Neo4j

Neo4j: Sum relationship properties where node properties equal Value A and Value B (intersection)
MATCH (updates)-[r:TAGGED_WITH]->(tag1 {name: 'Meeting'}), (updates)-[r:TAGGED_WITH]->(tag2 {name: 'ProjectA'}) RETURN SUM(r.TimeSpent) as totalTimeSpent, count(updates); This should find all updates tagged with both of those things, and sum all time spent across all of those updates.

Categories : Neo4j

collect distinct nodes and relations from multiple rows
When I run this query, I don't get duplicate data. But I can see why you might think there's duplicate data. First, you could try this: MATCH path=(p:Label)-[*..100]->() WITH DISTINCT(path) as path RETURN [n in nodes(path) | ID(n)] as nodeIds, [n in nodes(path)] as nodes, [r in relationships(path) | ID(r)] as relationshipIds, [r in relationships(path) | type(r)] as

Categories : Neo4j

No documentation on how to use neo4j pipe | in foreach
You can use the pipe e.g. when constructing a collection based on another collection, aka list comprehension. E.g. extract a property from all nodes along a path: MATCH path=(me:Person {name:'myself'})-[:KNOWS*..5]-(other) RETURN [x in nodes(path) | x.name ] FOREACH uses the pipe in the same way, see http://neo4j.com/docs/stable/query-foreach.html.

Categories : Neo4j

Neo4j JDBCCypherExecutor blocks thread
Separate threads might be the issue here, as the JDBC driver keeps the transaction in a thread local, so if you spawn new threads it creates new transaction objects and new connections (if you don't reuse the same Connection instance. And the default pooling of HttpClient is (afaik) 10 parallel connections.

Categories : Neo4j

Cypher - Return nodes with their relation with a count contraint on the relation
Untested, but you should be able to unwind your rels collection and pull out the start and end nodes. Something like: MATCH (doc:document)-[contain]-(sentence)-[with]-(ng1:word)-[rel:relations]-(ng2:word) WITH doc, count(rel) as nbRels, collect(rel) as rels WHERE nbRels > 10 WITH doc, UNWIND(rels) as rel, RETURN doc, STARTNODE(rel), ENDNODE(rel) But you might just want to collect something d

Categories : Neo4j

Bug found : Using the graph database service API over rest
If you are looking for the shortest path(s) starting at F, ending at I, but going through H, you can look for: (a) The shortest path(s) from F to H, and (b) The shortest path(s) from H to I. By combining any path in (a) with any path in (b), you'd end up with (one of) the shortest path(s). Here is a basic solution that finds (a) and (b): MATCH (F:_schema_F),(H:_schema_H),(I:_schema_I) RETURN

Categories : Neo4j

Where is the key that signed neo4j-2.1.5-1.noarch.rpm?
Thanks for bringing this to our attention. I've re-signed all the RPM's with the key referenced in the instructions (the old one expired and broke all the Debian packages), and tested installation via yum install neo4j on an Amazon Linux machine. That worked OK. Note that our Yum/RPM support is still experimental. We'll probably sign those RPM's with a grown-up key soon, or even rebuild the wh

Categories : Neo4j

Match node with multiple properties in neo4j
How about generating a GUID/UUID that's unique for each person and using that as your ID for each Person? Then you could MERGE on that property quickly and use ON CREATE to set the other properties e.g. MERGE (p:Person {id: 'abcd-efgh-...'}) ON CREATE SET p.name = "mark", p.address = "..." Or if not then maybe a hash or combination of all those properties as your key e.g. MERGE (p:Person {id:

Categories : Neo4j

Is neo4j compatible with websockets out-of-the-box?
I did some experiments with using websockets & cypher which was pretty straightforward: https://github.com/jexp/cypher_websocket_endpoint And for instance http://structr.org supports Websockets on top of Neo4j out of the box.

Categories : Neo4j

CYPHER: Querying the next hop node
Assuming you have a HAS_SUBGROUP relationship linking a parent group to each child group, this query should return each team the user is a direct member of, and for each team, the distinct collection of ancestor teams. MATCH (:PERSON {name: "user"})-[:IS_MEMBER_OF*]->(team:GROUP) OPTIONAL MATCH (team)<-[:HAS_SUBGROUP*]-(ancestor_team) RETURN team, COLLECT(DISTINCT ancestor_team);

Categories : Neo4j

How to join 2 tables in cypher, NEO4J
[Edited] Assuming (from the earlier version of your question) that the following properties all belong to nodes with the Film label: film_id title rental_rate replacement_cost rental_value , that the following properties all belong to Film_category: category_name , and that the model looks like: (:Film)-[:HAS_CATEGORY]->(:Film_category) , then this query will answer your question:

Categories : Neo4j

Finding Paths with Neo4j Cypher Below a Given Length, but Excluding Those with an Nodes with a Specific Property set to a Specific Value
I think this does what I want: MATCH path=(topic: attribute)-[rel:describedBy|influences]-(node: attribute) WHERE id(topic) IN [128204] RETURN DISTINCT extract(r IN rels(path) | r) UNION MATCH path=(topic: attribute)-[rel1: describedBy|influences]-(intermediate: attribute)-[rel2: describedBy|influences]-(node: attribute) WHERE id(topic) IN [128204] AND NOT intermediate.key in ['enrichment', 'clas

Categories : Neo4j


Recently Add
Neo4j server plugin and complex type input
neo4j ::how to set shortpath query timeout property in embedded model?
Neo4j-shell query result size in MB
Neo4j values from WITH disappears if subsequent MATCH fails
Neo4j: Recursive query for simple node structure
Return one result per person in neo4j
Neo4j: Create slef relation cypher query
py2neo 2.0: ERROR:httpstream:! SocketError: timed out
Neo4j: Sum relationship properties where node properties equal Value A and Value B (intersection)
collect distinct nodes and relations from multiple rows
No documentation on how to use neo4j pipe | in foreach
Neo4j JDBCCypherExecutor blocks thread
Cypher - Return nodes with their relation with a count contraint on the relation
Bug found : Using the graph database service API over rest
Where is the key that signed neo4j-2.1.5-1.noarch.rpm?
Match node with multiple properties in neo4j
Is neo4j compatible with websockets out-of-the-box?
CYPHER: Querying the next hop node
How to join 2 tables in cypher, NEO4J
Finding Paths with Neo4j Cypher Below a Given Length, but Excluding Those with an Nodes with a Specific Property set to a Specific Value
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.