Questions tagged [neo4j-apoc]

APOC is short for "Awesome Procedures on Cypher." Introduced in Neo4j release 3.0, APOCs are callable procedures which extend the Cypher query language.Questions with the neo4j-apoc tag should be for "small, generic helper functions for common tasks" that are not available in the Cypher query language.

APOC procedures are "User Defined Procedures." They are similar to stored procedures in some relational databases. APOCs can be written in any language that runs on the JVM. Questions tagged with neo4j-apoc should have an accompanying tag for the specific language being used.

Built in procedures are included in Neo4j releases. Before posting a question on StackOverflow, please consult the Neo4j documentation and ask if your task is possible in the public chat channels.

685 questions
0
votes
1 answer

Shortest path for each node in collection/json Neo4j apoc

Short task description: I have a json document, composed of a set of origin/source nodes, for each of them I need to find 1st, 2nd and 3rd shortest path to the set of target nodes. The input json is as follows: { "origin":[ …
0
votes
0 answers

Is it possible to filter relationships using it's properties in apoc.path.spanningTree()?

I need to get a spanning tree from a node. Relationships have numeric update_time property. The spanning tree should contain only the recent relationships (update_time >= period_start). I tried to use apoc.path procedures, but it seems that they do…
Rob Yart
  • 323
  • 1
  • 2
  • 13
0
votes
3 answers

Visualize connected components in Neo4j

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)…
Jannat Arora
  • 2,759
  • 8
  • 44
  • 70
0
votes
2 answers

Get last element of array by parsing JSON with Neo4j APOC

Short task description: I need to get the last element of an array/list of one of the fields in nested JSON, here the input JSON file: { "origin": [{ "label": "Alcohol drinks", "tag": [], "type": "string", …
0
votes
1 answer

Neo4j: How to have '|' as delimeter when export data in csv?

I am using the following query to save my data as csv file on my Desktpo: CALL apoc.export.csv.query("MATCH (a) RETURN a", 'C:/Users/Raf/Desktop/results.csv', {}); This query returns me a csv where the data are in quotes and the delimeter is a…
raf
  • 137
  • 2
  • 12
0
votes
1 answer

Sending parameters to APOC in Cypher Neo4J

I need to send several relationship IDs to an APOC function in my Neo4J Cypher request: PROFILE UNWIND $contexts as cons WITH cons CALL apoc.index.relationships('TO','context:cons') YIELD rel, start, end WITH DISTINCT rel, start, end WHERE…
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
0
votes
1 answer

apoc.path.expandConfig() extract (subject)-[object]->(predicate) triplet

I am trying to write a cypher query which when given a particular start and a fixed terminating node will go ahead and expand the path and extract me the nodes and the relationships in the following format. (node1)-[relation]->[node2] i.e…
Kunal Mukherjee
  • 5,775
  • 3
  • 25
  • 53
0
votes
3 answers

Neo4j: How to find all property names for a given node label

In neo4j, is there a way to get the names of all properties for a given node label. There are plenty of articles explaining how to do this for a given node, but I need to get all property names for all nodes that belong to a give label.
DatsunBing
  • 8,684
  • 17
  • 87
  • 172
0
votes
2 answers

Any way to filter out the most frequent terms in Neo4J APOC request?

I have the following request: CALL apoc.index.relationships('TO','context:34b4a5b0-0dfa-11e9-98ed-7761a512a9c0') YIELD rel, start, end WITH DISTINCT rel, start, end RETURN DISTINCT start.uid AS source_id, start.name AS source_name, end.uid…
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
0
votes
1 answer

Several arguments apoc.index.relationships in Neo4J Cypher

I currently have a request: CALL apoc.index.relationships('TO','context:15229100-b20e-11e3-80d3-6150cb20a1b9') YIELD rel, start, end Does anybody know how I can search for several context values, for example, something like: CALL…
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
0
votes
1 answer

How to make multi level path traversal faster in Neo4j

I want to find all the paths from the leaf node(E) to the root node(A). (Not for any specific node, so no id or filed filter here) The data model is as shown in the image. I used a basic Cypher query to find the paths (A to E): MATCH…
Rajendra Kadam
  • 4,004
  • 1
  • 10
  • 24
0
votes
1 answer

Ignoring a property within Cypher Query OR alternative: how count relationship sequences

the following Cypher statements give me the graph output (see image) below the code. And also the text output below the image. My problem is the text output. I will try to explain the problem clearly: I am interested in the same sequences of two…
CodeIsland
  • 61
  • 2
  • 10
0
votes
1 answer

Accessing map values from neo4, apoc, Cypher

I am still rather new to Neo4j, Cypher and programming in general. Is there a way to access the posted output below, i.e. access the "count" values for every "item“ (which has to be the pair), and also access the "item" values? I need the amount of…
CodeIsland
  • 61
  • 2
  • 10
0
votes
1 answer

What Cypher query to retrieve the relations of certain nodes to each other in Neo4J?

TL:DR: I need to find the most efficient Cypher query that would get the nodes connected to a certain node type with a certain type of relation and to then retrieve the connections between those nodes, filter out the top 150 most connected ones,…
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
0
votes
2 answers

Store date in neo4j

The given date format in CSV is '(Fri) 09 Jan 2018 (32)'. This should feed to database as a date column to allow order by date. How could convert above format to Neo4j date format at the insertion time ?
era
  • 391
  • 4
  • 24