neo4j-apoc

How to group or merge virtual relationship created using apoc.create.vRelationship among nodes in neo4j?

无人久伴 提交于 2020-01-25 08:00:06
问题 There is a set of artists, from which some artists create a temporary group and organize a event in any city. After it different groups organize events in different city or same city as done by some other group. I want to query the data when artist A participates in the event then the events done in same city by Artist B in a series of Dates with below Cypher query but get duplicate virtual relationship for Artist A & Event and also for Event & City. MATCH seriesB = (bArtist:Artist)-[:HAS

How to calculate rank for float values in Neo4j?

核能气质少年 提交于 2020-01-06 04:50:11
问题 I am calculating a set of paths using apoc.algo.dijkstra. My goal is to assign a rank to each of the suggested paths. Important is all the weights among nodes are floats. Cypher code: ... WITH origin, target CALL apoc.algo.dijkstra(origin, target, 'link', 'Weight') yield path as path, weight as weight ... what I have now: Path 1 - Weight: 1.2344332423 Path 2 - Weight: 0.8432423321 Path 3 - Weight: 0.9144331653 Something what I need is: rank: 1, weight: 1.2344332423 rank: 2, weight: 0

Adding millions of nodes to neo4j spatial layer using cypher and apoc

半世苍凉 提交于 2020-01-04 06:50:28
问题 I have a data set of 3.8million nodes and I'm trying to load all of these into Neo4j spatial. The nodes are going into a simple point layer, so have the required latitude and longitude fields. I've tried: MATCH (d:pointnode) WITH collect(d) as pn CALL spatial.addNodes("point_geom", pn) yield count return count But this just keeps spinning without anything happening. I've also tried (I've been running the next query all on one line, but I've just split it up for ease of reading): CALL apoc

Adding millions of nodes to neo4j spatial layer using cypher and apoc

ⅰ亾dé卋堺 提交于 2020-01-04 06:50:27
问题 I have a data set of 3.8million nodes and I'm trying to load all of these into Neo4j spatial. The nodes are going into a simple point layer, so have the required latitude and longitude fields. I've tried: MATCH (d:pointnode) WITH collect(d) as pn CALL spatial.addNodes("point_geom", pn) yield count return count But this just keeps spinning without anything happening. I've also tried (I've been running the next query all on one line, but I've just split it up for ease of reading): CALL apoc

Is there a way to remove _id _type from cypher result

梦想与她 提交于 2020-01-04 05:54:29
问题 I'm converting the result of my query to a tree using the apoc.convert.toTree() procedure and then I filter the result to get only couple properties. However, in the resulting payload I get two properties _id and _type that I'm unable to remove. this is my query where I' supposed to get only prefLabel and uri: MATCH p=(n {uri:'https://enterprise.poolparty.biz/Taxo_test/11325'})-[:narrower*]->(m) WHERE NOT ()-[:narrower]->(n) WITH COLLECT(p) AS ps call apoc.convert.toTree(ps, true, { nodes:

Visualize connected components in Neo4j

眉间皱痕 提交于 2019-12-30 14:08:14
问题 I can find the highest densely connected component in the graph using the code below: CALL algo.unionFind.stream('', ':pnHours', {}) YIELD nodeId,setId // groupBy setId, storing all node ids of the same set id into a list MATCH (node) where id(node) = nodeId WITH setId, collect(node) as nodes // order by the size of nodes list descending ORDER BY size(nodes) DESC LIMIT 1 // limiting to 3 RETURN nodes; But it does not help me visualize the topmost densely connected component (sub-graph)

Visualize connected components in Neo4j

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 14:08:01
问题 I can find the highest densely connected component in the graph using the code below: CALL algo.unionFind.stream('', ':pnHours', {}) YIELD nodeId,setId // groupBy setId, storing all node ids of the same set id into a list MATCH (node) where id(node) = nodeId WITH setId, collect(node) as nodes // order by the size of nodes list descending ORDER BY size(nodes) DESC LIMIT 1 // limiting to 3 RETURN nodes; But it does not help me visualize the topmost densely connected component (sub-graph)

Neo4j manual/explicit indexes and non-string range queries

时光总嘲笑我的痴心妄想 提交于 2019-12-24 14:06:12
问题 I was able to port my Neo4j 3.4.0 application to use manual indexes and APOC procedures instead of queries over the indexles relationship properties. Everything is working like a charm except one last thing - I ran into the issue with non-string Lucene range queries. They are not working as expected Lucene query language and numeric range For example: I'm applying the following Lucene query predicate in order to get all inclusive numbers in 2 to 6 range: value:[2 TO 6] and receive the

Neo4j Cypher manual relationship index, APOC trigger and data duplication

旧时模样 提交于 2019-12-24 09:52:29
问题 I have the following query that uses plain relationship operations for node filtering: MATCH (dg:DecisionGroup)-[:CONTAINS]->(childD:Decision) WHERE dg.id = 1 MATCH (childD)-[relationshipValueRel2:HAS_VALUE_ON]->(filterCharacteristic2:Characteristic) WHERE filterCharacteristic2.id = 2 WITH relationshipValueRel2, childD, dg WHERE (ANY (id IN [".NET"] WHERE id IN relationshipValueRel2.value )) RETURN childD.name which returns only one node(as it was expected): "Candidate1" PROFILE output: I'd

Neo4j long lasting query to be split/executed in smaller chunks?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 07:46:41
问题 My import.csv creates many nodes and merging creates a huge cartesian product and runs in a transaction timeout since the data has grown so much. I've currently set the transaction timeout to 1 second because every other query is very quick and is not supposed to take any longer than one second to finish. Is there a way to split or execute this specific query in smaller chunks to prevent a timeout? Upping or disabling the transaction timeout in the neo4j.conf is not an option because the