neo4j-contrib / neo4j-apoc-procedures Goto Github PK
View Code? Open in Web Editor NEWAwesome 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
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
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
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!
get membership
use bolt to distribute query
return results aggregated with machine source
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.
... and adopt gradle build to run asciidoctor with /docs as target dir.
When the first character is for ex #
, the Google API returns an exception which yields a RuntimeException for the Cypher query :
{
"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
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.
to reproduce:
call apoc.static.set("key","value")
call apoc.static.list("")
gives back an entry with "ey","value"
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
I was thinking of something along these lines:
match (ip:IpAddress) where apoc.IpAddress.IsInSameNetwork(nodewithipaddress,MASK)
yield return ip
In case of e.g. German umlauts clean
just removes those characters. I assume general expectation is convert those to a base form.
I guess the same issue arises with any non standard text character.
http://stackoverflow.com/questions/1008802/converting-symbols-accent-letters-to-english-alphabet has some solution for this.
Before changing this I'd love to hear comments from others.
This can help to eliminate loop path
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.
Based on the following example :
http://stackoverflow.com/questions/37088730/delete-several-items-from-a-linked-list
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
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.
readme only contains project information (install, versioning, ....)
docs live in /docs as separate files
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
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!
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).
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
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?
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.
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 procedure
apoc.periodic.iterate: Caused by: java.lang.RuntimeException: Error during future.get
Using {parallel:false} on relationship creates works as expected.
a call like
call apoc.meta.subGraph({labels:['Person','Test'],rels: ['KNOWS'],sample:50})
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
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
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
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
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
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
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]
The build of the jar stops while testing (apoc.date.Datetest), report below.
Regards
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)
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
.
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
add a function e.g. apoc.cypher.runTimeboxed(cypher, param, timeout)
that terminates the transaction if running longer than timeout.
Something like this
CALL apoc.path.expand(node(s),
{
out: [rels],
in: [rels],
both: [rels],
include: [labels],
exclude: [labels],
min: 0
max: 3
...
})
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.
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?
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.
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?
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
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 procedureapoc.es.stats
: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json: Failed to invoke procedureapoc.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 procedureapoc.gephi.add
: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json: Failed to invoke procedureapoc.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/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] 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:
[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-reportsT 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 procedureapoc.es.stats
: Caused by: java.lang.RuntimeException: Can't read url http://localhost:9200/_stats as json: Failed to invoke procedureapoc.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 procedureapoc.gephi.add
: Caused by: java.lang.RuntimeException: Can't read url http://localhost:8080/workspace1?operation=updateGraph as json: Failed to invoke procedureapoc.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
To avoid security concerns with JS etc. we could use Cypher for basic scripting (like computing weights or path-expansion for algorithms).
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}
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?
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.