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 ...

0
votes
1answer
14 views

Neo4j/Cypher: Extracting the last item of a StringArray (This what neo4j called it)

Lets say I have a node with a property, Event, that is assigned a StringArray. I am trying to extract '6013' and '6005' that were assigned from a collection when the node was created ( see below for ...
0
votes
1answer
28 views

Neo4j/Cypher: Passing properties through WITH

I am posting a new question because this is a separate but related issue to this question: Neo4j: Link Different Nodes to the one node The below query is returning the correct number of nodes. ...
0
votes
0answers
21 views

How to use “apoc.map.fromPairs” in Neo4j and APOC v3.4.0.1?

I am new to neo4j and I am trying to play with it by trying to load an XML file into a map. I tried the following example posted in APOC User Guide: call apoc.load.xml("https://raw.githubusercontent....
0
votes
2answers
46 views

Neo4j: Link Different Nodes to the one node

Let's say you have the following 4 nodes: Set 1: (act: "Event Log", timestamp: 3461000) (act: "Uptime Report", timestamp: 3461000) Set 2: (act: "Event Log", timestamp: 149100) (act: "Uptime Report", ...
1
vote
0answers
22 views

neo4j apoc.trigger.add with property update

I am trying to implement trigger on neo4j to execute when single property gets changed CALL apoc.trigger.add('setUpdated-reference',' UNWIND apoc.trigger.propertiesByKey({assignedNodeProperties}, "...
0
votes
0answers
13 views

Unable to Fetch Data that Cloned Using apoc.refactor.cloneNodesWithRelationships in Single Function

Currently I have this problem where I can't fetch the duplicated node after the node is cloned using apoc.refactor.cloneNodesWithRelationships. So my structure code is just like this : ObjectService ...
0
votes
1answer
21 views

Java Neo4j - There is no procedure with the name `apoc.refactor.mergeNodes`

I'm using a Neo4j Java application with the APOC procedures: xml import and mergeNodes. The xml import is fine, but I can't tell the same for mergeNodes function. I know how to register APOC ...
0
votes
1answer
21 views

Relationship Direction can't be retained after using call apoc.refactor.cloneNodesWithRelationships

I'm using neo4j community edition 3.0.6 and apoc 3.0.8.6. I'm having this issues where i tried to copy a node that already have multiple relationship. Then when I use call apoc.refactor....
0
votes
2answers
20 views

neo4j get values that match a criteria

I'm working on a neo4j query trying to return a node that has a total ownership of 1 (representing 100%). So I'm summing the ownership of a node. My query to get the sum of ownership works correctly ...
0
votes
1answer
23 views

set apoc.import.file.enabled=true in your neo4j.conf

I have a Neo4j Java project perfectly working inside my Eclipse IDE. I use APOC to load an XML file and process it. Since now I have to deploy my project, I need to export a Runnable Jar file. The ...
1
vote
0answers
30 views

How can I add a manual APOC index to a property that contains a list of strings

I'm trying to add a fulltext index on a field which contains a list of strings. For example, a Strings node might look like this: { "strings": ["hello", "world"] } I'm adding an index using the ...
0
votes
0answers
20 views

Py2neo merge nodes using name and property in Neo4j

I am mapping state transitions in APIs using Neo4j. My Relationship also has a property. The relationship is the count of the response codes. I want to merge them all together including the property. ...
0
votes
1answer
20 views

Neo4j compare sums from different queries and display result

Is there a way that i compare results from different queries? Could the following queries be written in a single query together with the return for the wanted result? Query1: Returns countries and ...
0
votes
1answer
46 views

Collection in WITH clause gets expanded to one element per row

I want to create a map projection with node properties and some additional information. Also I want to collect some ids in a collection and use this later in the query to filter out nodes (where ID(n) ...
0
votes
1answer
28 views

Neo4j APOC A* with conditions

I have successfully used the following to get the shortest path using A* in the APOC library. apoc.algo.aStar("A", "B", 'Link', 'Length','X','Y') YIELD path, weight apoc.algo.aStar("A", "B", 'Link', ...
0
votes
2answers
45 views

Failed to invoke procedure `apoc.load.csv`: Caused by: java.io.IOException: Cannot open file test.csv for reading

I am using Neo4j 3.4.7 and this is simple query i tried to run: CALL apoc.load.csv('test.csv') yield lineNo, map , list RETURN *; after getting error I set following apoc related rules in conf ...
1
vote
2answers
31 views

Streaming data from Neo4j to Gephi - “Invalid UTF-8 start byte 0xfc”

I have recently started working with Neo4j and I am interested in visualizing my graph in Gephi. To do that, I am trying to use the apoc procedure CALL apoc.gephi.add(null,'workspace1', paths) ...
0
votes
1answer
19 views

MERGE instead of CREATE for apoc.create.relationship()

The procedure apoc.create.relationship(n1,RelType,{},n2) behaves accordingly to the CREATE statement. If a relationship of type RelType already exists between nodes n1 and n2 apoc.create.relationship(...
0
votes
1answer
45 views

Cypher merge nodes with same property and collected the other property

I have nodes with this structure (g:Giocatore { nome, match, nazionale}) (nome:'Del Piero', match:'45343', nazionale:'ITA') (nome:'Messi', match:'65324', nazionale:'ARG') (nome:'Del Piero', match:'...
1
vote
1answer
18 views

Neo4j Cypher how to include another relationship node of parent in APOC neo4j cypher query

Let us considered Drone (Parent) Quadcropter (Child) Pixel (Grand Child) with [:SUB_CATEGORY] as relationship node below Cypher query to fetch along with its parts tagged with each nodes MATCH ...
0
votes
1answer
13 views

Neo4j Java APOC query

I have my java app using Neo4j API. Everything works fine, except when I pass by args the path of my file to process. This is the code working fine: session.run("call apoc.xml.import(\"http://www....
-1
votes
1answer
40 views

How to get the data in parent and child and sub child format in neo4j

I wants to get the result from the below query without headers.Can you please suggest me how to get the result. MATCH (p:seller) OPTIONAL MATCH (p)-[:SOLD]->(c) RETURN {parent : p.name, child : {...
0
votes
1answer
48 views

OutOfMemoryError: Java heap space in Neo4j

I am trying to retrieve all the fields from the joined tables. The size of the result is supposed to be 5893886 records. Every time I try to run this query using Neo4j driver for Scala, I get this ...
0
votes
1answer
32 views

apoc.periodic.commit doesn't result in updates

The following query results in 10 updated nodes: MATCH (a:ns3__Organization)-[r:ns4__isDomiciledIn]->(b:Resource) WITH a,b LIMIT 10 SET a.isDomiciledIn = b.Country I'm trying to apply it to my ...
1
vote
1answer
23 views

how to use “apoc.util.md5” in embedded neo4j

I find some code examples here about enabling APOC in embedded neo4j. It is something like that i need to register the procedure's class. (but lack of description. wonder if there is official ...
0
votes
0answers
15 views

Neo4j graph-algorithm procedure Memory issue

I have about 32M nodes and 28M relationships. The schema is like the following. (User)-[:DEVICE]->(Device) (User)-[:EMAIL]->(Email) (User)-[:SHIPPED]->(Shipzip) (User)-[:PHONE]->(Phone)...
1
vote
1answer
41 views

Neo4J APOC apoc.import.csv error

I am trying to import Nodes & Relationships from .csv files into Neo4J using APOC. While trying the example provided: CALL apoc.import.csv( [{filename: 'file:/<path>/persons.csv', labels:...
0
votes
1answer
149 views

Filtering inbound nodes in Neo4Jbased on properties of an outbound node

While working on a data lineage project, I am faced with a complex Neo4J Cypher challenge that I have no idea how to 'attack'. This is the Meta-example: There are 10 nodes, A1 to A10 Each of these ...
0
votes
2answers
40 views

Spring @DataNeo4jTest with Procedure Support

I'm writing Spring Data Neo4J repository tests with @DataNeo4jTest and all is well until I write a test against a custom query that uses a procedure, for example apoc.coll.intersection. The error ...
-1
votes
1answer
32 views

Queries on 200 GB graph

I am in need to use a scalable solution to create a Geohash connected graph. I find Cypher for APache Spark a project that let use cypher on spark dataframes to create a graph, however it can only ...
0
votes
1answer
21 views

Neo4J User Defined Functions - How to deploy new functions?

I'm learning Cypher since yesterday and I read about the user defined functions. There's many material on how to use the functions, but not many on how to deploy new ones. I would like to try out ...
0
votes
1answer
41 views

A* Neo4j return all paths and conditions on edges

I'm currently using the apoc library to get the shortest path with a cost (length) apoc.algo.aStar( startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance','lat','lon' ) ...
1
vote
1answer
53 views

Neo4j: Create paths/subgraph from APOC virtual relationships for streaming to Gephi

I have a Neo4j database comprising Film and Person nodes connected by ACTED_IN relationships. Using APOC, I've managed to create a set of virtual ACTED_WITH relationships directly between Person nodes ...
0
votes
1answer
27 views

How to upgrade neo4j from 2.2.9 to 3.4.0?

I want to upgrade from 2.2.9 to 3.4.0. I have seen both .extension are different.V2.2.9 .graphdb but V3.4.0 .db also i'm getting error. Is there an option available to upgrade to 3.4.0? Please advise....
1
vote
0answers
35 views

Neo4j Path Finding

Im using Neo4j for path finding. I have a map of locations im using this query to find the shortest path MATCH (start:Node{id:'2067'}),(end:Node{id:'2068'}) call apoc.algo.aStar( start, end, '...
0
votes
1answer
23 views

Neo4j: Match APOC path using one node as optional in the specified path

I am using the following neo4j cypher query on my graph: MATCH (start:N1{id:'xyz'}) CALL apoc.path.expandConfig(start, {sequence:'N1, a>, N2, b>, N3, c>, N4', maxLevel:3}) YIELD path RETURN ...
0
votes
1answer
43 views

Convert multiple relationships between 2 nodes to a single one with weight

I have the following graph, describing co-occurrence of car brands in documents: CREATE (`0` :Car {value:"Ford"}) , (`1` :Car {value:"Subaru"}) , (`2` :Car {value:"VW"}) , (`0`)-[:`DOCUMENT` {...
0
votes
0answers
18 views

load data from EDL using neo4j

I have data present in EDL and I'm using impala query to fetch data from EDL. It contains transactional data and hence I need to update neo4j DB constantly. Need your help in designing the data load. ...
0
votes
1answer
30 views

Search from specific labels in neo4j

I have nodes with labels a, b, c, d and I want to search a node "node1" only from label "a" and label "b". If "node1" is found then return that node else create a node with label "a". I tried to do ...
0
votes
0answers
8 views

Neo4j to show dependencies on API

I am currently looking into graph databases that are available to visualize the dependency between services. I have a few heath check pages which will return JSON data as the response. And these have ...
1
vote
1answer
38 views

Index queries worsen query performance

I tried to use indexes on one of my queries to make it run faster, but it makes another query run slower. So I have one query for the data processing? which run faster with indexes and another one for ...
0
votes
0answers
42 views

Cypher How to Normalize Pagerank Scores

I have many papers in Neo4j that cite each other. The data looks like this: {"title": "TitleWave", "year": 2010, "references": ["002", "003"], "id": "001"} {"title": "Title002", "year": 2005, "...
0
votes
2answers
44 views

Neo4j primary results lost after secondary match fails

I have a match that returns results 'con'. I then want to try to refine the results by optionally intersecting it with other patterns. If their is an intersection on a secondary pattern then those ...
0
votes
1answer
43 views

Improve Neo4j query performance

I have a Neo4j query with searched multiple entities and I would like to pass parameters in batch using nodes object. However, I the speed of query execution is not quite high. How can I optimize this ...
0
votes
1answer
25 views

sorted map in cypher

When creating a map from collections via apoc's apoc.map.fromLists (or plain cypher for all I care), is there any way to respect/keep the sorting? Or is it just "It's a map, sorting doesn't make sense ...
0
votes
1answer
80 views

How to use Neo4j APOC when creating a DB in Java?

Instead of creating my Neo4j DBs using the Neo4j Desktop, I create it in a Java app from scratch. I usually have two csv files: a nodes file and a relationships file. So, I create my DBs in two steps: ...
0
votes
1answer
30 views

Neo4J Insertion taking time

I have a query which is taking the long time to insert in neo4j roughly the query looks like following : create index on :symaccess_symdev(dir_port); create index on :symaccess_symdev(host_lun); ...
0
votes
1answer
89 views

NEO4j Return a nested, hierarchical JSON from a DB

I have a Tree Model on db like it's shown on the picture City node is linked to Region node by IS_A_City_BELONGING_TO Sector node is linked to Region node by IS_A_SECTOR_BELONGING_TO_THAT_REGION ...
0
votes
2answers
41 views

Unparseable date: “NULL” with APOC.DATE.PARSE

I am using apoc to calculate difference between two dates. It works when I supply value for N.ID in the MATCH clause. But it fails when I remove N.ID because I am trying to process the code for a ...
1
vote
0answers
35 views

Performance problems during Neo4J import / conversion with multiple steps

We import via apoc.load.jdbc(...) around 100'000 nodes to Neo4J 3.4.0. The import script consists of several steps. Among other things, the original graph is converted into an extended graph, which ...