Giter Site home page Giter Site logo

neo4j-contrib / neo4j-apoc-procedures Goto Github PK

View Code? Open in Web Editor NEW
1.7K 73.0 489.0 53.1 MB

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            

Home Page: https://neo4j.com/labs/apoc

License: Apache License 2.0

Java 91.87% HTML 0.70% Kotlin 4.66% JavaScript 0.01% Cypher 2.01% ANTLR 0.02% Roff 0.73%
graph-database graph-algorithms stored-procedures neo4j neo4j-plugin hacktoberfest

neo4j-apoc-procedures's Introduction

Discourse users Discord

Awesome Procedures for Neo4j 4.4.x

Introduction

apoc

Neo4j 3.x introduced the concept of user-defined procedures and functions. Those are custom implementations of certain functionality, that can’t be (easily) expressed in Cypher itself. They are implemented in Java and can be easily deployed into your Neo4j instance, and then be called from Cypher directly.

The APOC library consists of many (about 450) procedures and functions to help with many different tasks in areas like data integration, graph algorithms or data conversion.

License

Apache License 2.0

"APOC" Name history

Apoc was the technician and driver on board of the Nebuchadnezzar in the Matrix movie. He was killed by Cypher.

APOC was also the first bundled A Package Of Component for Neo4j in 2009.

APOC also stands for "Awesome Procedures On Cypher"

Installation: With Neo4j Desktop

APOC Full can be installed with Neo4j Desktop, after creating your database, by going to the Manage screen, and then the Plugins tab. Click Install in the APOC box and wait until you see a green check mark near "APOC".

desktop apoc

Feedback

Please provide feedback and report bugs as GitHub issues or join the Neo4j Community Forum and ask with the APOC tag.

Calling Procedures & Functions within Cypher

User defined Functions can be used in any expression or predicate, just like built-in functions.

Procedures can be called stand-alone with CALL procedure.name();

But you can also integrate them into your Cypher statements which makes them so much more powerful.

Load JSON example
WITH 'https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/4.4/core/src/test/resources/person.json' AS url

CALL apoc.load.json(url) YIELD value as person

MERGE (p:Person {name:person.name})
   ON CREATE SET p.age = person.age, p.children = size(person.children)

APOC Procedures & Functions Overview

All included procedures are listed in the overview in the documentation and detailed in subsequent sections.

Built in Help

apoc help apoc

call apoc.help('keyword')

lists name, description, signature, roles, based on keyword

Detailed Feature Documentation

See the APOC User Guide for documentation of each of the major features of the library, including data import/export, graph refactoring, data conversion, and more.

Procedure & Function Signatures

To call procedures correctly, you need to know their parameter names, types and positions. And for YIELDing their results, you have to know the output column names and types.

INFO:The signatures are shown in error messages, if you use a procedure incorrectly.

You can see the procedures signature in the output of CALL apoc.help("name")

CALL apoc.help("dijkstra")

The signature is always name : : TYPE, so in this case:

apoc.algo.dijkstra
 (startNode :: NODE?, endNode :: NODE?,
   relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?)
:: (path :: PATH?, weight :: FLOAT?)
Table 1. Parameter Explanation
Name Type

Procedure Parameters

startNode

Node

endNode

Node

relationshipTypesAndDirections

String

weightPropertyName

String

Output Return Columns

path

Path

weight

Float

Manual Installation: Download latest release

Since APOC relies on Neo4j’s internal APIs you need to use the matching APOC version for your Neo4j installaton. Make sure that the first two version numbers match between Neo4j and APOC.

Go to the latest release for Neo4j version 4.4 and download the binary jar to place into your $NEO4J_HOME/plugins folder.

You can find all releases here.

Manual Configuration

Warning

For security reasons, procedures and functions that use internal APIs are disabled by default. Loading and enabling APOC procedures and functions can be configured using the Neo4j config file. For more details, see the APOC installation documentation.

Version Compatibility Matrix

Since APOC relies in some places on Neo4j’s internal APIs you need to use the right APOC version for your Neo4j installaton.

APOC uses a consistent versioning scheme: <neo4j-version>.<apoc> version. The trailing <apoc> part of the version number will be incremented with every apoc release.

apoc version neo4j version

4.4.0.1

4.4.0 (4.3.x)

4.3.0.4

4.3.7 (4.3.x)

4.2.0.9

4.2.11 (4.2.x)

4.1.0.10

4.1.11 (4.1.x)

4.0.0.18

4.0.12 (4.0.x)

3.5.0.15

3.5.30 (3.5.x)

3.4.0.8

3.4.18 (3.4.x)

3.3.0.4

3.3.9 (3.3.x)

3.2.3.6

3.2.14 (3.2.x)

3.1.3.9

3.1.9 (3.1.x)

3.0.8.6

3.0.12 (3.0.x)

3.5.0.0

3.5.0-beta01

3.4.0.2

3.4.5

3.3.0.3

3.3.5

3.2.3.5

3.2.3

3.1.3.8

3.1.5

Get APOC Version

To know your current apoc version you can use the function :

RETURN apoc.version();

Using APOC with the Neo4j Docker image

APOC Full can be used with the Neo4j Docker image via the NEO4JLABS_PLUGINS environment variable. If we use this environment variable, the APOC plugin will be downloaded and configured at runtime.

Note

This feature is intended to facilitate using APOC in development environments, but it is not recommended for use in production environments.

The following runs Neo4j 4.0 in a Docker container with the latest version of the APOC Library
docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    -e NEO4JLABS_PLUGINS=\[\"apoc\"\] \
    neo4j:4.0

We should see the following two lines in the output after running this command:

Fetching versions.json for Plugin 'apoc' from https://neo4j-contrib.github.io/neo4j-apoc-procedures/versions.json
Installing Plugin 'apoc' from https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.28/4.4.0.28-all.jar to /plugins/apoc.jar

In a production environment we should download the APOC release matching our Neo4j version and, copy it to a local folder, and supply it as a data volume mounted at /plugins.

The following downloads the APOC Library into the plugins directory and then mounts that folder to the Neo4j Docker container
mkdir plugins
pushd plugins
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.4.0.28/apoc-4.4.0.28-all.jar
popd
docker run --rm -e NEO4J_AUTH=none -p 7474:7474 -v $PWD/plugins:/plugins -p 7687:7687 neo4j:4.4

If you want to pass custom apoc config to your Docker instance, you can use environment variables, like here:

docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    neo4j

Build & install the current development branch from source

git clone https://github.com/neo4j-contrib/neo4j-apoc-procedures
cd neo4j-apoc-procedures
./gradlew shadow
cp build/full/libs/apoc-<version>-all.jar $NEO4J_HOME/plugins/
$NEO4J_HOME/bin/neo4j restart

A full build including running the tests can be run by ./gradlew build.

Applying Code-style

./gradlew spotlessApply

To apply the spotless code-style, run the above gradle command, this will remove all unused imports

neo4j-apoc-procedures's People

Contributors

adam-cowley avatar adtc avatar albertodelazzari avatar alexiudice avatar angelobusato avatar azuobs avatar bradnussbaum avatar conker84 avatar fbiville avatar gem-neo4j avatar github-actions[bot] avatar ikwattro avatar inversefalcon avatar jexp avatar jmhreif avatar kvegter avatar lojjs avatar loveleif avatar mishademianenko avatar mneedham avatar moxious avatar nadja-muller avatar ncordon avatar neo4j-oss-build avatar sarmbruster avatar szarnyasg avatar tomasonjo avatar vboulaye avatar vga91 avatar zimmre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo4j-apoc-procedures's Issues

APOC maven build fails apoc.gephi.GephiTest

Just pulled the master branch, and tried to build the jar with

mvn clean install

I get the following error in tests:

Results :

Tests in error: 
  testAdd(apoc.gephi.GephiTest): Failed to invoke procedure `apoc.gephi.add`: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json

Tests run: 317, Failures: 0, Errors: 1, Skipped: 9

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:48 min
[INFO] Finished at: 2016-07-12T17:40:35+02:00
[INFO] Final Memory: 18M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project apoc: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/gu/Workspace/neo4j-apoc-procedures/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

This is the file in surefire-reports:
apoc.gephi.GephiTest.txt

clean up docs

readme only contains project information (install, versioning, ....)
docs live in /docs as separate files

apoc.meta.subGraph() returns rows without counts

a call like

call apoc.meta.subGraph({labels:['Person','Test'],rels: ['KNOWS'],sample:50})

returns
screen shot 2016-08-18 at 09 00 45

and this result in json

{
   "columns":[
      "nodes",
      "relationships"
   ],
   "data":[
      {
         "row":[
            [
               {
                  "name":"Aanbod"
               },
               {
                  "name":"BDR"
               },
               {
                  "name":"Entity"
               },
               {
                  "name":"GTN"
               },
               {
                  "name":"InterActor"
               },
               {
                  "name":"Person",
                  "count":31
               },
               {
                  "name":"Test",
                  "count":14
               },
               {
                  "name":"User"
               }
            ],
            [
               {
                  "type":"KNOWS",
                  "count":4
               },
               {
                  "type":"KNOWS",
                  "count":1
               },
               {
                  "type":"KNOWS",
                  "count":4
               },
               {
                  "type":"KNOWS",
                  "count":30
               },
               {
                  "type":"KNOWS",
                  "count":2
               },
               {
                  "type":"KNOWS",
                  "count":4
               },
               {
                  "type":"KNOWS",
                  "count":2
               },
               {
                  "type":"KNOWS",
                  "count":1
               }
            ]
         ],
         "meta":[
            {
               "id":-598,
               "type":"node",
               "deleted":false
            },
            {
               "id":-595,
               "type":"node",
               "deleted":false
            },
            {
               "id":-594,
               "type":"node",
               "deleted":false
            },
            {
               "id":-597,
               "type":"node",
               "deleted":false
            },
            {
               "id":-593,
               "type":"node",
               "deleted":false
            },
            {
               "id":-591,
               "type":"node",
               "deleted":false
            },
            {
               "id":-596,
               "type":"node",
               "deleted":false
            },
            {
               "id":-592,
               "type":"node",
               "deleted":false
            },
            {
               "id":-2999,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-3000,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2993,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2995,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2998,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2994,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2996,
               "type":"relationship",
               "deleted":false
            },
            {
               "id":-2997,
               "type":"relationship",
               "deleted":false
            }
         ],
         "graph":{
            "nodes":[
               {
                  "id":"-593",
                  "labels":[
                     "InterActor"
                  ],
                  "properties":{
                     "name":"InterActor"
                  }
               },
               {
                  "id":"-594",
                  "labels":[
                     "Entity"
                  ],
                  "properties":{
                     "name":"Entity"
                  }
               },
               {
                  "id":"-595",
                  "labels":[
                     "BDR"
                  ],
                  "properties":{
                     "name":"BDR"
                  }
               },
               {
                  "id":"-596",
                  "labels":[
                     "Test"
                  ],
                  "properties":{
                     "name":"Test",
                     "count":14
                  }
               },
               {
                  "id":"-597",
                  "labels":[
                     "GTN"
                  ],
                  "properties":{
                     "name":"GTN"
                  }
               },
               {
                  "id":"-598",
                  "labels":[
                     "Aanbod"
                  ],
                  "properties":{
                     "name":"Aanbod"
                  }
               },
               {
                  "id":"-591",
                  "labels":[
                     "Person"
                  ],
                  "properties":{
                     "name":"Person",
                     "count":31
                  }
               },
               {
                  "id":"-592",
                  "labels":[
                     "User"
                  ],
                  "properties":{
                     "name":"User"
                  }
               }
            ],
            "relationships":[
               {
                  "id":"-2993",
                  "type":"KNOWS",
                  "startNode":"-592",
                  "endNode":"-591",
                  "properties":{
                     "type":"KNOWS",
                     "count":4
                  }
               },
               {
                  "id":"-2994",
                  "type":"KNOWS",
                  "startNode":"-593",
                  "endNode":"-591",
                  "properties":{
                     "type":"KNOWS",
                     "count":4
                  }
               },
               {
                  "id":"-2995",
                  "type":"KNOWS",
                  "startNode":"-591",
                  "endNode":"-591",
                  "properties":{
                     "type":"KNOWS",
                     "count":30
                  }
               },
               {
                  "id":"-2996",
                  "type":"KNOWS",
                  "startNode":"-594",
                  "endNode":"-591",
                  "properties":{
                     "type":"KNOWS",
                     "count":2
                  }
               },
               {
                  "id":"-2997",
                  "type":"KNOWS",
                  "startNode":"-591",
                  "endNode":"-594",
                  "properties":{
                     "type":"KNOWS",
                     "count":1
                  }
               },
               {
                  "id":"-2998",
                  "type":"KNOWS",
                  "startNode":"-591",
                  "endNode":"-595",
                  "properties":{
                     "type":"KNOWS",
                     "count":2
                  }
               },
               {
                  "id":"-2999",
                  "type":"KNOWS",
                  "startNode":"-595",
                  "endNode":"-591",
                  "properties":{
                     "type":"KNOWS",
                     "count":4
                  }
               },
               {
                  "id":"-3000",
                  "type":"KNOWS",
                  "startNode":"-597",
                  "endNode":"-598",
                  "properties":{
                     "type":"KNOWS",
                     "count":1
                  }
               }
            ]
         }
      }
   ],
   "stats":{
      "contains_updates":false,
      "nodes_created":0,
      "nodes_deleted":0,
      "properties_set":0,
      "relationships_created":0,
      "relationship_deleted":0,
      "labels_added":0,
      "labels_removed":0,
      "indexes_added":0,
      "indexes_removed":0,
      "constraints_added":0,
      "constraints_removed":0
   }
}

while

match (n:BDR) return count(n)

returns the correct count of 3

path expander for patterns

variable path length on patterns instead of single relationships. Don’t have a syntax for this to suggest, but assume you want to search for ()-[:TYPE_A]→()-[:TYPE_B]→() e.g. 2..5 times.

match (a)-[r*]→(b) where all rels in the path are this pattern ()-[:Foo]→()-[:Bar]→()

pass in array with rel-type into rel-expander, test types[path.length % types.length]

apoc.date.formatTimeZone missing in jar

really, really helpful set of procedures. Would be great if some or all of these shipped with Neo.

just a heads up - looks like the apoc.date.formatTimeZone didn't make into the latest jar build.

call dbms.procedures()

apoc.date.fields apoc.date.fields(date :: STRING?, pattern :: STRING?) :: (value :: MAP?)
apoc.date.fieldsDefault apoc.date.fieldsDefault(date :: STRING?) :: (value :: MAP?)
apoc.date.format apoc.date.format(time :: INTEGER?, unit :: STRING?, format :: STRING?) :: (value :: STRING?)
apoc.date.formatDefault apoc.date.formatDefault(time :: INTEGER?, unit :: STRING?) :: (value :: STRING?)
apoc.date.parse apoc.date.parse(time :: STRING?, unit :: STRING?, format :: STRING?) :: (value :: INTEGER?)
apoc.date.parseDefault apoc.date.parseDefault(time :: STRING?, unit :: STRING?) :: (value :: INTEGER?)

using 3.0.3 and the downloaded latest build of the apoc.jar

thanks

Michael

Strict mode for apoc.meta.subGraph

Can there be a strict mode for subGraph? Currently, for the relationship types I specify, all labels that connect those relationship types appear. For me, this makes the subGraph not so useful, as it doesn't really allow me to focus on a particular set of labels and/or a particular set of relationships.

I could do the changes. Just let me know your thoughts on this. The map makes it easy to extend the method just by adding support for a new strict key (I would like it to default to true, but to keep original behavior, I'll default it to false).

Typos in Algos section of docs

Hi,

found a couple typos in the docs...

MATCH (node:Node)
WHERE node.id %2 = 0
WITH collect(node) AS nodes
CALL apoc.algo.closeness(['TYPE'],nodes,INCOMING) YIELD node, score
RETURN node, score
ORDER BY score DESC

should read
--> CALL apoc.algo.closeness(['TYPE'],nodes,'INCOMING') YIELD node, score

MATCH (node:Node)
WHERE node.id %2 = 0
WITH collect(node) AS nodes
CALL apoc.algo.betweenness(['TYPE'],nodes,BOTH) YIELD node, score
RETURN node, score
ORDER BY score DESC

should read
--> CALL apoc.algo.betweenness(['TYPE'],nodes,'BOTH') YIELD node, score

thanks!

Bug: Can't use pairs in FOREACH

The apoc.coll.pairs([list]) procedure looks ideal for creating linked lists of nodes, and seems like it should be easier to use than some kind of double FOREACH loop or iteration over an index.

However, if we use the generated pairs in a FOREACH to try to match, merge, or create nodes based upon the list and link them up, we fail with an error.

Here is an example case:

WITH ["a", "b", "c", "d", "e"] as letters
CALL apoc.coll.pairs(letters) YIELD value as names
// last pair unnecessary, as it pairs the last element with null
WITH names[..SIZE(names)-1] as names
FOREACH (pair in names |
MERGE (a:Thing{name: pair[0]})
MERGE (b:Thing{name: pair[1]})
MERGE (a)-[:relates_to]->(b))

This fails with the following error:

Type mismatch: expected Collection<T> but was Any
Attempting to use head(pair) or last(pair) returns the same error.

If instead of using pairs() we explicitly used [["a","b"],["b","c"],["c","d"],["d","e"]], it works fine:

WITH [["a","b"],["b","c"],["c","d"],["d","e"]] as names
FOREACH (pair in names |
MERGE (a:Thing{name: pair[0]})
MERGE (b:Thing{name: pair[1]})
MERGE (a)-[:relates_to]->(b))

Please fix when possible.

Typos in Algos section of docs - cliques

Hi Michael

here's another...

apoc.algo.cliques(minSize) YIELD cliques

should read:
--> apoc.algo.cliques(minSize) YIELD clique

apoc.algo.cliquesWithNode(startNode, minSize) YIELD cliques

should read:
--> apoc.algo.cliquesWithNode(startNode, minSize) YIELD clique

cannot build the package by pulling the latest source

Here is the log while executing maven


T E S T S

Running apoc.refactor.GraphRefactoringTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.579 sec
Running apoc.convert.ConvertJsonTest
root = {_id=0, _type=Movie, title=M, acted_in=[{_id=1, _type=Actor, name=A1, acted_in.role=R1}, {_id=2, _type=Actor, name=A2, acted_in.role=R2}]}
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.131 sec
Running apoc.convert.ConvertTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.62 sec
Running apoc.util.UtilsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.268 sec
Running apoc.util.UtilTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.073 sec
Running apoc.data.ExtractTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.249 sec
Running apoc.path.ExpandPathTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.76 sec
Running apoc.path.RelationshipTypeAndDirectionsTest
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.283 sec
Running apoc.graph.GraphsTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.755 sec
Running apoc.bitwise.BitwiseOperationsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.361 sec
Running apoc.example.ExamplesTest
{relationships=250, file=movies.cypher, nodes=169, format=cypher, source=example movie database from themoviedb.org, time=2201, properties=558}
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.495 sec
Running apoc.es.ElasticSearchTest
Ignoring Exception org.neo4j.graphdb.QueryExecutionException: Failed to invoke procedure apoc.es.stats: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json: Failed to invoke procedure apoc.es.stats: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json due to cause class java.net.ConnectException
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.671 sec
Running apoc.help.HelpScannerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.888 sec
Running apoc.periodic.PeriodicTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.546 sec
Running apoc.spatial.SpatialTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.354 sec
Running apoc.spatial.GeocodeTest
Fast google test took 2305ms
Slow google test took 9973ms
Fast osm test took 4374ms
Slow osm test took 12007ms
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 29.074 sec
Running apoc.spatial.DistanceTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.566 sec
Running apoc.meta.MetaTest
{other=[Movie], count=1, existence=false, index=false, label=ACTED_IN, right=1, type=RELATIONSHIP, sample=null, rightCount=1, leftCount=1, array=false, left=1, unique=false, property=Actor}
{other=[], count=0, existence=false, index=false, label=ACTED_IN, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=false, property=roles}
{other=[], count=0, existence=false, index=true, label=Movie, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=false, property=title}
{other=[Movie], count=1, existence=false, index=false, label=Actor, right=1, type=RELATIONSHIP, sample=null, rightCount=1, leftCount=1, array=false, left=1, unique=false, property=ACTED_IN}
{other=[], count=0, existence=false, index=true, label=Actor, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=true, property=name}
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.779 sec
Running apoc.index.SchemaIndexTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.745 sec
Running apoc.index.FulltextIndexTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.528 sec
Running apoc.index.FreeTextQueryParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.133 sec
Running apoc.index.FreeTextSearchTest
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "neo4j.PauseMonitor"
Tests run: 11, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 47.495 sec <<< FAILURE!
Running apoc.date.TTLTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.088 sec
Running apoc.date.DateTest
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.576 sec
Running apoc.schema.SchemasTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.083 sec
Running apoc.cypher.CypherTest
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.998 sec
Running apoc.algo.PathFindingTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.632 sec
Running apoc.algo.CoverTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.272 sec
Running apoc.algo.PageRankTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.48 sec
Running apoc.algo.LabelPropagationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.3 sec
Running apoc.algo.CliquesTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.823 sec
Running apoc.algo.CentralityTest
Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.527 sec
Running apoc.algo.pagerank.PageRankAlgoTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.828 sec
Running apoc.monitor.StoreInfoProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.47 sec
Running apoc.monitor.IdsProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.39 sec
Running apoc.monitor.KernelProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.112 sec
Running apoc.monitor.LockProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.381 sec
Running apoc.map.MapsTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.225 sec
Running apoc.export.ExportTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.8 sec
Running apoc.create.CreateTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.482 sec
Running apoc.warmup.WarmupTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.767 sec
Running apoc.gephi.GephiTest
Ignoring Exception org.neo4j.graphdb.QueryExecutionException: Failed to invoke procedure apoc.gephi.add: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json: Failed to invoke procedure apoc.gephi.add: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json due to cause class java.net.ConnectException
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.76 sec
Running apoc.coll.ArrayListTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running apoc.coll.SetBackedListTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.079 sec
Running apoc.coll.CollTest
contains sorted test on 1000000 elements took 7188 ms
contains test on 1000000 elements took 950 ms
Tests run: 19, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.446 sec
Running apoc.coll.EqualityTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.114 sec
Running apoc.text.PhoneticTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.344 sec
Running apoc.text.StringsTest
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.076 sec
Running apoc.cache.StaticTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.058 sec
Running apoc.load.JdbcTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.724 sec
Running apoc.load.LoadCsvTest
Tests run: 14, Failures: 0, Errors: 14, Skipped: 0, Time elapsed: 279.35 sec <<< FAILURE!
Running apoc.load.LoadJsonTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 42.764 sec <<< FAILURE!
Running apoc.load.XmlTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 42.932 sec <<< FAILURE!
Running apoc.search.ParallelNodeSearchTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 43.347 sec <<< FAILURE!
Running apoc.get.GetTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 87.006 sec <<< FAILURE!

Results :

Tests in error:
shouldPopulateIndexInBatches(apoc.index.FreeTextSearchTest): Java heap space
testLoadCsvTabSeparator(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/ user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvTabSeparator(apoc.load.LoadCsvTest)
testLoadCsvColonSeparator(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /hom e/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvColonSeparator(apoc.load.LoadCsvTest)
testLoadCsvSkip(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo 4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvSkip(apoc.load.LoadCsvTest)
testLoadCsv(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-a poc-procedures/target/test-data/impermanent-db
testLoadCsv(apoc.load.LoadCsvTest)
testMapping(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-a poc-procedures/target/test-data/impermanent-db
testMapping(apoc.load.LoadCsvTest)
testLoadCsvIgnoreFields(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/ user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvIgnoreFields(apoc.load.LoadCsvTest)
testLoadCsvNoHeader(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user /neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvNoHeader(apoc.load.LoadCsvTest)
testLoadJson(apoc.load.LoadJsonTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j -apoc-procedures/target/test-data/impermanent-db
testLoadJson(apoc.load.LoadJsonTest)
testLoadXml(apoc.load.XmlTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc- procedures/target/test-data/impermanent-db
testLoadXml(apoc.load.XmlTest)
apoc.search.ParallelNodeSearchTest: Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-a poc-procedures/target/test-data/impermanent-db
apoc.search.ParallelNodeSearchTest
testNodes(apoc.get.GetTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-pro cedures/target/test-data/impermanent-db
testNodes(apoc.get.GetTest)
testRels(apoc.get.GetTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-proc edures/target/test-data/impermanent-db
testRels(apoc.get.GetTest)

Tests run: 293, Failures: 0, Errors: 25, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:15.816s
[INFO] Finished at: Mon Jun 13 13:05:06 HKT 2016
[INFO] Final Memory: 30M/103M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project ap oc: There are test failures.
[ERROR]
[ERROR] Please refer to /home/user/neo4j-apoc-procedures/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
user@ubuntu-server:/neo4j-apoc-procedures$ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building neo4j-apoc-procedures 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apoc ---
[INFO] Deleting /home/user/neo4j-apoc-procedures/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.232s
[INFO] Finished at: Mon Jun 13 15:56:58 HKT 2016
[INFO] Final Memory: 6M/16M
[INFO] ------------------------------------------------------------------------
user@ubuntu-server:
/neo4j-apoc-procedures$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building neo4j-apoc-procedures 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apoc ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ apoc ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ apoc ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 113 source files to /home/user/neo4j-apoc-procedures/target/classes
[WARNING] /home/user/neo4j-apoc-procedures/src/main/java/apoc/meta/Meta.java: Some input files use unchecked or unsafe operations.
[WARNING] /home/user/neo4j-apoc-procedures/src/main/java/apoc/meta/Meta.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ apoc ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 14 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ apoc ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 58 source files to /home/user/neo4j-apoc-procedures/target/test-classes
[WARNING] /home/user/neo4j-apoc-procedures/src/test/java/apoc/date/TTLTest.java: Some input files use or override a deprecated API.
[WARNING] /home/user/neo4j-apoc-procedures/src/test/java/apoc/date/TTLTest.java: Recompile with -Xlint:deprecation for details.
[WARNING] /home/user/neo4j-apoc-procedures/src/test/java/apoc/util/UtilTest.java: Some input files use unchecked or unsafe operations.
[WARNING] /home/user/neo4j-apoc-procedures/src/test/java/apoc/util/UtilTest.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ apoc ---
[INFO] Surefire report directory: /home/user/neo4j-apoc-procedures/target/surefire-reports

T E S T S

Running apoc.refactor.GraphRefactoringTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.202 sec
Running apoc.convert.ConvertJsonTest
root = {_id=0, _type=Movie, title=M, acted_in=[{_id=1, _type=Actor, name=A1, acted_in.role=R1}, {_id=2, _type=Actor, name=A2, acted_in.role=R2}]}
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.256 sec
Running apoc.convert.ConvertTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.987 sec
Running apoc.util.UtilsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.258 sec
Running apoc.util.UtilTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.082 sec
Running apoc.data.ExtractTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.441 sec
Running apoc.path.ExpandPathTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.457 sec
Running apoc.path.RelationshipTypeAndDirectionsTest
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.135 sec
Running apoc.graph.GraphsTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.798 sec
Running apoc.bitwise.BitwiseOperationsTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.269 sec
Running apoc.example.ExamplesTest
{relationships=250, file=movies.cypher, nodes=169, format=cypher, source=example movie database from themoviedb.org, time=2066, properties=558}
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.349 sec
Running apoc.es.ElasticSearchTest
Ignoring Exception org.neo4j.graphdb.QueryExecutionException: Failed to invoke procedure apoc.es.stats: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json: Failed to invoke procedure apoc.es.stats: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json due to cause class java.net.ConnectException
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.78 sec
Running apoc.help.HelpScannerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.141 sec
Running apoc.periodic.PeriodicTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.451 sec
Running apoc.spatial.SpatialTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.344 sec
Running apoc.spatial.GeocodeTest
Fast google test took 4016ms
Slow google test took 9965ms
Fast osm test took 4158ms
Slow osm test took 11984ms
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 30.51 sec
Running apoc.spatial.DistanceTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.458 sec
Running apoc.meta.MetaTest
{other=[Movie], count=1, existence=false, index=false, label=ACTED_IN, right=1, type=RELATIONSHIP, sample=null, rightCount=1, leftCount=1, array=false, left=1, unique=false, property=Actor}
{other=[], count=0, existence=false, index=false, label=ACTED_IN, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=false, property=roles}
{other=[], count=0, existence=false, index=true, label=Movie, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=false, property=title}
{other=[Movie], count=1, existence=false, index=false, label=Actor, right=1, type=RELATIONSHIP, sample=null, rightCount=1, leftCount=1, array=false, left=1, unique=false, property=ACTED_IN}
{other=[], count=0, existence=false, index=true, label=Actor, right=0, type=STRING, sample=null, rightCount=0, leftCount=0, array=false, left=0, unique=true, property=name}
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.345 sec
Running apoc.index.SchemaIndexTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.625 sec
Running apoc.index.FulltextIndexTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.757 sec
Running apoc.index.FreeTextQueryParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.083 sec
Running apoc.index.FreeTextSearchTest
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "neo4j.PauseMonitor"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "neo4j.Scheduled-1"
Tests run: 11, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 44.497 sec <<< FAILURE!
Running apoc.date.TTLTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.777 sec
Running apoc.date.DateTest
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.43 sec
Running apoc.schema.SchemasTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.597 sec
Running apoc.cypher.CypherTest
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.649 sec
Running apoc.algo.PathFindingTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.086 sec
Running apoc.algo.CoverTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.312 sec
Running apoc.algo.PageRankTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.06 sec
Running apoc.algo.LabelPropagationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.195 sec
Running apoc.algo.CliquesTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.045 sec
Running apoc.algo.CentralityTest
Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.536 sec
Running apoc.algo.pagerank.PageRankAlgoTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.871 sec
Running apoc.monitor.StoreInfoProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.564 sec
Running apoc.monitor.IdsProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.4 sec
Running apoc.monitor.KernelProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.336 sec
Running apoc.monitor.LockProcedureTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.335 sec
Running apoc.map.MapsTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.914 sec
Running apoc.export.ExportTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.166 sec
Running apoc.create.CreateTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.266 sec
Running apoc.warmup.WarmupTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.481 sec
Running apoc.gephi.GephiTest
Ignoring Exception org.neo4j.graphdb.QueryExecutionException: Failed to invoke procedure apoc.gephi.add: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json: Failed to invoke procedure apoc.gephi.add: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json due to cause class java.net.ConnectException
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.096 sec
Running apoc.coll.ArrayListTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running apoc.coll.SetBackedListTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 sec
Running apoc.coll.CollTest
contains sorted test on 1000000 elements took 5220 ms
contains test on 1000000 elements took 1135 ms
Tests run: 19, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.279 sec
Running apoc.coll.EqualityTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.893 sec
Running apoc.text.PhoneticTest
Tests run: 8, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 65.517 sec <<< FAILURE!
Running apoc.text.StringsTest
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.727 sec
Running apoc.cache.StaticTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 33.433 sec <<< FAILURE!
Running apoc.load.JdbcTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 25.611 sec <<< FAILURE!
Running apoc.load.LoadCsvTest
Tests run: 14, Failures: 0, Errors: 14, Skipped: 0, Time elapsed: 290.3 sec <<< FAILURE!
Running apoc.load.LoadJsonTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 41.88 sec <<< FAILURE!
Running apoc.load.XmlTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 41.83 sec <<< FAILURE!
Running apoc.search.ParallelNodeSearchTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 42.051 sec <<< FAILURE!
Running apoc.get.GetTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 84.858 sec <<< FAILURE!

Results :

Tests in error:
shouldPopulateIndexInBatches(apoc.index.FreeTextSearchTest): Java heap space
shouldComputeEmptySoundexEncodingForTheEmptyString(apoc.text.PhoneticTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
shouldComputeEmptySoundexEncodingForTheEmptyString(apoc.text.PhoneticTest)
apoc.cache.StaticTest: Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
apoc.cache.StaticTest
apoc.load.JdbcTest: Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
apoc.load.JdbcTest
testLoadCsvTabSeparator(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvTabSeparator(apoc.load.LoadCsvTest)
testLoadCsvColonSeparator(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvColonSeparator(apoc.load.LoadCsvTest)
testLoadCsvSkip(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvSkip(apoc.load.LoadCsvTest)
testLoadCsv(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsv(apoc.load.LoadCsvTest)
testMapping(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testMapping(apoc.load.LoadCsvTest)
testLoadCsvIgnoreFields(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvIgnoreFields(apoc.load.LoadCsvTest)
testLoadCsvNoHeader(apoc.load.LoadCsvTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadCsvNoHeader(apoc.load.LoadCsvTest)
testLoadJson(apoc.load.LoadJsonTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadJson(apoc.load.LoadJsonTest)
testLoadXml(apoc.load.XmlTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testLoadXml(apoc.load.XmlTest)
apoc.search.ParallelNodeSearchTest: Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
apoc.search.ParallelNodeSearchTest
testNodes(apoc.get.GetTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testNodes(apoc.get.GetTest)
testRels(apoc.get.GetTest): Error starting org.neo4j.test.TestGraphDatabaseFactory$1$1, /home/user/neo4j-apoc-procedures/target/test-data/impermanent-db
testRels(apoc.get.GetTest)

Tests run: 290, Failures: 0, Errors: 31, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14:09.913s
[INFO] Finished at: Mon Jun 13 16:12:04 HKT 2016
[INFO] Final Memory: 31M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project apoc: There are test failures.
[ERROR]
[ERROR] Please refer to /home/user/neo4j-apoc-procedures/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Error : Expected path to be a path.

MATCH (a:STATION {name: 'A'}), (b:STATION{name: 'D'})
CALL apoc.algo.dijkstra(a, b, 'ROUTE', 'cost') yield path as path, weight as weight
RETURN path, weight, rels(path)

It will return error:

Expected path to be a path.

Is it true that "path" is not in path data type?

apoc.algo.dijkstra returning same results across rows

Input

MATCH (a:STATION {name: 'BA'}), (b:STATION{name: 'BC'})
CALL apoc.algo.dijkstra(a, b, 'ROUTE', 'cost') yield path as path, weight as weight
RETURN path, weight

It returns

╒═════════════════════════════════════════════╤══════╕
│path                                         │weight│
╞═════════════════════════════════════════════╪══════╡
│[{name: BA}, {route: 2, cost: 3}, {name: BC}]│3     │
├─────────────────────────────────────────────┼──────┤
│[{name: BA}, {route: 2, cost: 3}, {name: BC}]│3     │
└─────────────────────────────────────────────┴──────┘

And I have tested other cases, the same case happens.

I have longed the function for long time! Good work!

Problem with loading json

I have a problem with the second part of the loadJson. I works to load the Json using:

CALL apoc.util.loadJson('http://localhost/result.json')

But if I add the part starting with YIELD... I get the following error:

Invalid input 'Y': expected whitespace, comment, ';' or end of input (line 1, column 57 (offset: 56))
"CALL apoc.util.loadJson('http://localhost/result.json') YIELD value as person"

Regards

G.

User Cypher as basic scripting language

To avoid security concerns with JS etc. we could use Cypher for basic scripting (like computing weights or path-expansion for algorithms).

Idea

use a cypher fragment return a*10+b and a map of parameters {a:3,b:5}

eval('return a*10+b',{a:3,b:5})

Internally prefix the cypher statement with a WITH clause and concatenate the fragment

WITH {a} as a, {b} as b
return a*10+b

A more involved approach could use plain expressions and be responsible for mapping variables from cypher with a separate "mapping list",

CALL apoc.eval('return a*10+b AS c',{a:3,b:5},['c'])

The output of this execution would be rows with maps with the elements mapped aka here a single row:

{c:35}

utf-8 problem in geocoding

In many countries, addresses have umlauts

CALL apoc.spatial.geocode('Rämistrasse 71 8006 Zürich Switzerland', 1) YIELD location, latitude, longitude, description

yields

Failed to invoke procedure `apoc.spatial.geocode`: Caused by: java.lang.RuntimeException: Can't read url http://nominatim.openstreetmap.org/search.php?q=R%E4mistrasse+71+8006+Z%FCrich+Switzerland&format=json as json

Utf-encoding the characters in the query works:

CALL apoc.spatial.geocode('R%C3%A4mistrasse 71 8006 Z%C3%BCrich Switzerland', 1) YIELD location, latitude, longitude, description

yields

(no rows)

Would it not be nice to have utf encoding directly in the stored procedures or explicitly delegate it to the user? Thank you!

apoc.algo.cover failing with runtime exception

Hi Michael,

from the 1.1 release

MATCH (n:TestData) CALL apoc.algo.cover(n) YIELD rel RETURN *

Failed to invoke procedure apoc.algo.cover: Caused by: java.lang.RuntimeException: Can't convert class org.neo4j.kernel.impl.core.NodeProxy to a stream of long ids

thanks

Michael

Unit test failure on maven clean install: testfieldsCustomFormat(apoc.date.DateTest)

I'm seeing the following unit test failure on installing neo4j-apoc-procedures:

`Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.716 sec <<< FAILURE!
testfieldsCustomFormat(apoc.date.DateTest) Time elapsed: 0.148 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<E[ET]> but was:<E[urope/Bucharest]>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at apoc.date.DateTest.lambda$testfieldsCustomFormat$15(DateTest.java:190)
at apoc.util.TestUtil.lambda$testCall$0(TestUtil.java:39)
at apoc.util.TestUtil.testResult(TestUtil.java:51)
at apoc.util.TestUtil.testCall(TestUtil.java:36)
at apoc.util.TestUtil.testCall(TestUtil.java:24)
at apoc.date.DateTest.testfieldsCustomFormat(DateTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running apoc.get.GetTest
...
Failed tests: testfieldsCustomFormat(apoc.date.DateTest): expected:<E[ET]> but was:<E[urope/Bucharest]>`

Running on Mac OS X 10.11.4 with jdk1.8.0_92.jdk.

apoc.path.expand result Expected to be a path

This query:

MERGE (A1:Crx {id:1})-[:inx]->(A2:Crx {id:2})-[:inx]->(A3:Crx {id:3})
WITH A1
CALL apoc.path.expand( A1, 'inx>', '+Crx', 1, 3) YIELD path AS pathway
RETURN A1.id, NODES(pathway)

Gives an error message:

Expected pathway to be a path.
Neo.ClientError.Statement.SyntaxError

This query operates without errors:

MERGE (A1:Crx {id:1})-[:inx]->(A2:Crx {id:2})-[:inx]->(A3:Crx {id:3})
WITH A1
CALL apoc.path.expand( A1, 'inx>', '+Crx', 1, 3) YIELD path AS pathway
RETURN A1.id, pathway

Build failure

Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.485 sec <<< FAILURE!
testfieldsCustomFormat(apoc.date.DateTest)  Time elapsed: 0.13 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<E[ET]> but was:<E[urope/Bucharest]>
    at org.junit.Assert.assertEquals(Assert.java:115)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at apoc.date.DateTest.lambda$testfieldsCustomFormat$41(DateTest.java:190)
    at apoc.date.DateTest$$Lambda$176/13478280.accept(Unknown Source)
    at apoc.util.TestUtil.lambda$testCall$0(TestUtil.java:39)
    at apoc.util.TestUtil$$Lambda$134/1675375648.accept(Unknown Source)
    at apoc.util.TestUtil.testResult(TestUtil.java:51)
    at apoc.util.TestUtil.testCall(TestUtil.java:36)
    at apoc.util.TestUtil.testCall(TestUtil.java:24)
    at apoc.date.DateTest.testfieldsCustomFormat(DateTest.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :

Failed tests:   testfieldsCustomFormat(apoc.date.DateTest): expected:<E[ET]> but was:<E[urope/Bucharest]>

Tests run: 106, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:01 min
[INFO] Finished at: 2016-05-01T17:14:21-07:00
[INFO] Final Memory: 30M/256M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project apoc: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/nicolewhite/GitHub/neo4j-apoc-procedures/target/surefire-reports for the individual test results.

What do?

apoc.periodic.iterate fails on relationship creates when {parallel:true}

Using parallel true to create many nodes using periodic.iterate works fine but using it to create relationships fails, presumably because one of the batches has a lock on the nodes being touched by one of the other parallel processes.

Don't know enough about the internals but the resulting number of relationships that is created varies with each execution suggesting it is a race condition of this nature.

The error produced is this:
Failed to invoke procedureapoc.periodic.iterate: Caused by: java.lang.RuntimeException: Error during future.get

Using {parallel:false} on relationship creates works as expected.

fails to deploy on Neo 3.0.3

I'm running neo 3.03 on wondows using the apoc 1.1.0 jar and I'm getting this error on startup:
from neo log:

Failed to load apoc.mongodb.MongoDBColl from plugin jar /E:/Programs/neo4j-enterprise-3.0.3/plugins/apoc-1.1.0.jar: org/bson/conversions/Bson

from debug log:
ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2abb22a1' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2abb22a1' was successfully initialized, but failed to start. Please see attached cause exception.
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2abb22a1' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:68)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:217)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:87)
at org.neo4j.server.BlockingBootstrapper.start(BlockingBootstrapper.java:43)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:66)
at org.neo4j.server.enterprise.EnterpriseEntryPoint.start(EnterpriseEntryPoint.java:42)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@2abb22a1' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:189)
... 4 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.enterprise.EnterpriseFacadeFactory, E:\Programs\neo4j-enterprise-3.0.3\data\databases\graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:144)
at org.neo4j.kernel.impl.enterprise.EnterpriseFacadeFactory.newFacade(EnterpriseFacadeFactory.java:42)
at org.neo4j.graphdb.EnterpriseGraphDatabase.(EnterpriseGraphDatabase.java:57)
at org.neo4j.server.enterprise.EnterpriseNeoServer.lambda$static$1(EnterpriseNeoServer.java:85)
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:89)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:434)
... 6 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.proc.Procedures@5cd9156a' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:140)
... 11 more
Caused by: org.neo4j.kernel.api.exceptions.ProcedureException: Procedures must return a Stream of records, where a record is a concrete class
that you define, with public non-final fields defining the fields in the record.

Error populating index with custom config

Hi , i've created a manual index with custom config :
CALL apoc.index.forNodes('org_fts_index',{type:'fulltext',to_lower_case:'true',analyzer:'org.apache.lucene.analysis.standard.StandardAnalyzer' })
i am trying to populate it with :
apoc.index.addNodeByLabel()
and i get the following error :
Failed to invoke procedure apoc.index.addNodeByLabel: Caused by: java.lang.IllegalArgumentException: Supplied index configuration: {provider=lucene, type=fulltext, to_lower_case=true} doesn't match stored config in a valid way: {type=fulltext, to_lower_case=true, provider=lucene, analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer} for 'org_fts_index'

Also calling apoc.index.addAllNodes() drops current index and creates a new one with new config instead of populating the current as said in help

apoc.index.addAllNodes('index-name',{label1:['prop1',…​],…​}) - add all nodes to this full text index with the given fields, additionally populates a 'search' index field with all of them in one place

Sugestion: add a neo4j function for FORMAT or TRANSFORM

Being new with neo4j, I can't found a integrated function that transform the output of numbers or strings.
Is "ugly" to see something like 12345678.901234, instead of clearest 12,345,678.90.
The same for dates, or strings. In fact, one of the most usefull and powerfull functions in Excel is, the ability to format a cell value.

Hope it helps
regards
Javier

Date.java overload parse, format and fields methods

This is concerning https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/master/src/main/java/apoc/date/Date.java

Instead of having methods like parseDefault, formatDefault and fieldsFormatted, why not just overload the methods with shorter names like parse, format and fields? The format argument would be optional. When not provided it will execute the method without the argument, and when provided it will execute the method with the argument. Wouldn't that be better?

Date.java format with custom time zone

How do I give a custom time zone for the format method? Currently it always returns the formatted time in UTC. Can you make a formatZone or formatTZ method that takes an additional time zone argument (in exactly the same format as the parse method would take timezone)?

I read the source code and there appears to be some timezone support but I don't quite understand. It seems to always default to UTC. How can you force it to a custom timezone?

The fourth argument for the new method could be anything that can be passed into ZoneId.of(String) and TimeZone.getTimeZone(String) methods, instead of UTC_ZONE_ID.

[spatial] check that first character of given address is alphanumeric

When the first character is for ex # , the Google API returns an exception which yields a RuntimeException for the Cypher query :

https://maps.googleapis.com/maps/api/geocode/json?address=#12-01+Ngee+Ann+City+Tower+A+391A+Orchard+Road+SINGAPORE+238873&key=true

{
   "error_message" : "Invalid request. Missing the 'address', 'bounds', 'components', 'latlng' or 'place_id' parameter.",
   "results" : [],
   "status" : "INVALID_REQUEST"
}
Failed to invoke procedure `apoc.spatial.geocodeOnce`: Caused by: java.lang.RuntimeException: Can't read url https://maps.googleapis.com/maps/api/geocode/json?address=#12-01+Ngee+Ann+City+Tower+A+391A+Orchard+Road+SINGAPORE+238873&key=true as json

Would be nice to check that the first character is alphanumeric

Separate modules

Would it be easy to separate out the groups of procs into modules that you could install separately, instead of one big bunch?

Is this even a problem? Is there a lot of overhead to installing apoc, even as it grows?

CALL apoc.load.json path ignores config file setting

Great set of stored procs!

I noticed a small issue with CALL apoc.load.json, not sure I'd call it a bug though. If you are loading JSON locally you have to use a different path convention to the CSV loader if you have a default path set in the config file. Not a massive issue but using windows 10 I seem to spend a fair amount of time tweaking paths until they work.....

For example with windows 10 the CSV loader format is:

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///file.csv" AS line

The equivalent in APOC would be:

WITH "file:///C:/default_location/file.json" AS url
CALL apoc.load.json(url) YIELD value

Build fails at testing

The build of the jar stops while testing (apoc.date.Datetest), report below.
Regards

G


Test set: apoc.date.DateTest

Tests run: 13, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.503 sec <<< FAILURE!
testfieldsCustomFormat(apoc.date.DateTest) Time elapsed: 0.299 sec <<< FAILURE!
org.junit.ComparisonFailure: expected:<E[ET]> but was:<E[urope/Bucharest]>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at apoc.date.DateTest.lambda$testfieldsCustomFormat$47(DateTest.java:190)
at apoc.util.TestUtil.lambda$testCall$0(TestUtil.java:39)
at apoc.util.TestUtil.testResult(TestUtil.java:51)
at apoc.util.TestUtil.testCall(TestUtil.java:36)
at apoc.util.TestUtil.testCall(TestUtil.java:24)
at apoc.date.DateTest.testfieldsCustomFormat(DateTest.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

apoc.algo.dijkstra: Failed to call procedure: RELATIONSHIP has no property with propertyKey

If one of the relations in the pattern has no properties responsible for the weight, the query produces an error:

MATCH (Start:Glycogenesis {title:'Glucose'}), 
             (End:Metabolism {title:'Lipid'})
CALL apoc.algo.dijkstra(Start, End, 'wClass>', 'path_index') YIELD path, weight
RETURN path, weight

Failed to call procedure apoc.algo.dijkstra(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?) :: (path :: PATH?, weight :: FLOAT?): RELATIONSHIP[{id}] has no property with propertyKey="path_index".

Neo.ClientError.Procedure.ProcedureCallFailed

Upd.:

Adding nodes and relationships:

MERGE (Start1:Test {name:'Start1'})
MERGE (Middle1:Test {name:'Middle1'})
MERGE (End1:Test {name:'End1'})
MERGE (Start1)-[:rel {cost: 10}]->(Middle1)-[:rel {cost: 20}]->(End1)

MERGE (Start2:Test {name:'Start2'})
MERGE (Middle2:Test {name:'Middle2'})
MERGE (End2:Test {name:'End2'})
MERGE (Start2)-[:rel {cost: 10}]->(Middle2)-[:rel]->(End2)

This query is executed without error:

MATCH (Start:Test {name:'Start1'}), (End: Test {name:'End1'})
CALL apoc.algo.dijkstra(Start, End, 'rel>', 'cost') YIELD path, weight
RETURN path, weight

But this query again gives the same error (RELATIONSHIP[...] has no property with propertyKey="cost".):

MATCH (Start:Test {name:'Start2'}), (Middle: Test {name:'Middle2'})
CALL apoc.algo.dijkstra(Start, Middle, 'rel>', 'cost') YIELD path, weight
RETURN path, weight

Feature Request: Breadth-first search with parameterized match limit

Neither the shortestPath() (including APOC's dijkstra procedure) or the APOC path expander support limiting the results to a given limit of matches, cutting off the search once the limit is hit (as opposed to generating all possible matches then trimming down to the desired results).

The primary use case is when you do not have definitive end nodes, and you're trying to find the first (or first n) matches of some thing along a path, especially when there are a great many matches along that path.

As an example, if :Person nodes are connected by [:KNOWS] relationships, and some :Person nodes are additionally labeled as :Doctor, you will have a hard time efficiently finding, for all :Persons, the path to their closest :Doctor following :KNOWS relationships.

The shortestPath() query and APOC's dijkstra() will not work here, as when you don't know your end nodes, or your search is for something very general, such as a node with a certain label, it generates a cartesian product and finds the shortest path between all matched start and end nodes.

Path expander is a little better, as it will only match against the end nodes along the expanded path, but it still does not have support for finding the first n matches then stopping.

A breadth-first search procedure to find the first n path matches, taking into account relationships to traverse, predicates on the desired nodes to match against, and possibly white/blacklists like path expander, would be very helpful for these kind of "n closest nodes like this" kind of queries.

There is no procedure with the name `apoc.algo.allSimplePaths` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.

When I try to call allSimplePath in my query I get the following error:
There is no procedure with the name apoc.algo.allSimplePaths registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.

Here is my query:
match (from:STATION{name:"s3"}), (to:STATION{name:"s7"})
CALL apoc.algo.allSimplePaths(from, to, '<L2S|L2S>', 10) yield path as path, weight as weight
return path ORDER BY length(path) asc limit 100

aggregation procedures

figure out aggregation

either tombstone triggering aggregation from threadlocal state

or separate init() procedure that generates a state object which is then passed into an aggregate(state) procedure, todo how to trigger the final aggregation.

parallel execution

Would improve timings of some queries like :

MATCH (user:User) WHERE id(user) = {id}
MATCH (user)-[:BOUGHT]->(product)<-[:BOUGHT]-(other)-[:BOUGHT]->(reco:Product)
USING SCAN reco:Product
USING JOIN ON other
RETURN reco, count(*) as score
ORDER BY score DESC LIMIT 10;

where you could parallel the process on the collaborators for eg

allow to attach cypher queries to tx handler (like triggers)

provide transaction data as parameters to cypher query

TODO make sure that this stays efficient as tx handlers are called frequently,
consider providing some filters/selectors that trigger only those statements that are relevant for the tx change

store those queries in graph properties

Geocode.java in Spatial violates the Nominatim AUP of Openstreetmap

Line 24:

String url = "http://nominatim.openstreetmap.org/search.php?q=" + address.replace(" ", "+") + "&format=json";

violates the acceptable use policy on Openstreetmap

  • No heavy uses (an absolute maximum of 1 request per second).
  • Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do).

There's no time delay, user agent, or usage enforcement mechanism in place and may result in IP bans. Unless these control features are added, it would be a good idea to implement passing in an API and url string so custom services can be used (mapbox, opencage, etc) instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.