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

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 SUM from all points given by countries that are not…
LexByte
  • 382
  • 4
  • 15
0
votes
1 answer

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) in ids...). The map projection is created in an…
Cesar
  • 1
  • 1
0
votes
1 answer

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', {weight:'Length',default:1, x:'X',y:'Y'}) YIELD…
Liam
  • 439
  • 1
  • 4
  • 26
0
votes
1 answer

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:'18235', nazionale:'ITA') The property 'match' is…
fprobo
  • 3
  • 2
0
votes
1 answer

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.example.com/myfile.xml\") YIELD node RETURN…
Wall
  • 293
  • 3
  • 13
0
votes
1 answer

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 whole graph with apoc.periodic.commit through the…
jvilledieu
  • 535
  • 2
  • 12
0
votes
2 answers

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 declares procedure apoc.coll.intersection is unknown.…
SingleShot
  • 18,821
  • 13
  • 71
  • 101
0
votes
1 answer

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 but I'm having a hard time on finding a step-by-step…
João Otero
  • 948
  • 1
  • 15
  • 30
0
votes
1 answer

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|', 'distance','lat','lon' ) YIELD path, weight There are two things I need: How…
Liam
  • 439
  • 1
  • 4
  • 26
0
votes
1 answer

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. 2018-08-14 19:11:15.489+0000 ERROR Failed to…
user2848031
  • 187
  • 12
  • 36
  • 69
0
votes
1 answer

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 path ORDER BY length(path) DESC Now I want to keep N3 as…
0
votes
1 answer

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` {value:"DOC-1"}]->(`1`) , (`0`)-[:`DOCUMENT`…
Marek Grzenkowicz
  • 17,024
  • 9
  • 81
  • 111
0
votes
1 answer

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 like this: Merge(n {id: "node1"}) on create set…
0
votes
0 answers

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, "references": ["003", "004"], "id": "002"} {"title":…
Tim Holdsworth
  • 489
  • 1
  • 3
  • 13
0
votes
2 answers

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 results should be returned otherwise the original…
Damon
  • 83
  • 8