Coder Social home page Coder Social logo

Comments (21)

jexp avatar jexp commented on August 14, 2024

Which version are you using?
How much java heap space do you use for your client?
How many nodes / paths are returned at depth 3 and how many do you expect at depth 4 ?

from java-rest-binding.

 avatar commented on August 14, 2024

Using version 1.8 …

     <dependency>

        <groupId>org.neo4j</groupId>

        <artifactId>neo4j-rest-graphdb</artifactId>

        <version>1.8</version>

     </dependency>

I have increased the memory to 1024m and to as much as 2gb to get this to work & it still blows up.

@ depth = 3; I get 1925 paths returned …

@ depth = 4; the call to TraversalDescription.traverse(startNode) doesn’t return, … it runs out of heap space …

robert -

[email protected]

From: Michael Hunger [mailto:[email protected]]
Sent: Tuesday, January 08, 2013 5:43 PM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Which version are you using?
How much java heap space do you use for your client?
How many nodes / paths are returned at depth 3 and how many do you expect at depth 4 ?


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKNkqX9WWzoXs61yq2s5DanFA2keXajXb4Z_ScD1mWJSE.gif

from java-rest-binding.

 avatar commented on August 14, 2024

The relationship I’m trying to resolve looks like this:

(person1) ---- [hasGraduatedFrom] ----> (college)<---- [hasGraduatedFrom] ----(person2)

person 1 has 2 relationships

the college has 383 relationships

person 2 has 2 relationships

From: Michael Hunger [mailto:[email protected]]
Sent: Tuesday, January 08, 2013 5:43 PM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Which version are you using?
How much java heap space do you use for your client?
How many nodes / paths are returned at depth 3 and how many do you expect at depth 4 ?


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKNkqX9WWzoXs61yq2s5DanFA2keXajXb4Z_ScD1mWJSE.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Robert, using a traversal like this is like pulling the whole db into memory and across the wire and running the graph operation in your client java code. I try to look into the issue itself but I think the json document returned is just too big to fit into memory.

should probably just use a cypher query like this:

start person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}),
match path=(person1)-[:hasGraduatedFrom]->(college)<-[:hasGraduatedFrom]-(person2)
return rels(path)

parameters.put("id1", rps.getPerson1PermId());
parameters.put("id2", rps.getPerson2PermId());

restApi.query(query,parameters);

or use RestCypherQueryEngine to run your query.

HTH

Michael

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Could you do me a favor and try the following:

RestTraversalDescription td = createTraversalDescription(rps);
Map map = td.getPostData();
System.out.println(org.neo4j.rest.graphdb.JsonHelper.createJsonFrom(map)); // put it into the file data.json

RestNode start = ...
System.out.println(start.getUri()+"/traverse/fullpath") // URI 

curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

and see how much data is returned?

You can also execute the request in java using HttpConnection but it is more effort to do.

from java-rest-binding.

 avatar commented on August 14, 2024

I will try all of this tomorrow AM. Thank you for your help.

On Jan 8, 2013, at 7:57 PM, "Michael Hunger" <[email protected]mailto:[email protected]> wrote:

Could you do me a favor and try the following:

RestTraversalDescription td = createTraversalDescription(rps);
Map map = td.getPostData();
System.out.println(org.neo4j.rest.graphdb.JsonHelper.createJsonFrom(map)); // put it into the file data.json

RestNode start = ...
System.out.println(start.getUri()+"/traverse/fullpath") // URI

curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

and see how much data is returned?

You can also execute the request in java using HttpConnection but it is more effort to do.


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-12026345.

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

But it is AM, 2 AM here :)

from java-rest-binding.

 avatar commented on August 14, 2024

getPostData() isn’t available from RestTraversalDescription

From: Michael Hunger [mailto:[email protected]]
Sent: Tuesday, January 08, 2013 7:58 PM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Could you do me a favor and try the following:

RestTraversalDescription td = createTraversalDescription(rps);
Map map = td.getPostData();
System.out.println(org.neo4j.rest.graphdb.JsonHelper.createJsonFrom(map)); // put it into the file data.json

RestNode start = ...
System.out.println(start.getUri()+"/traverse/fullpath") // URI

curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

and see how much data is returned?

You can also execute the request in java using HttpConnection but it is more effort to do.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKNkqX9WWzoXs61yq2s5DanFA2keXajXb4Z_ScD1mWJSE.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Sorry, it is RestTraversal which just implements RestTraversalDescription.

from java-rest-binding.

 avatar commented on August 14, 2024

$ curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

<title>Error 500 INTERNAL_SERVER_ERROR</title>

HTTP ERROR 500

Problem accessing /db/data/node/141995/traverse/fullpath. Reason:

    INTERNAL_SERVER_ERROR

Caused by:

java.lang.OutOfMemoryError
    at org.neo4j.server.rest.repr.NodeRepresentation$1.underlyingObjectToObject(NodeRepresentation.java:151)
    at org.neo4j.server.rest.repr.NodeRepresentation$1.underlyingObjectToObject(NodeRepresentation.java:147)
    at org.neo4j.helpers.collection.IterableWrapper$MyIteratorWrapper.underlyingObjectToObject(IterableWrapper.java:57)
    at org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
    at org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:58)
    at org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)
    at org.neo4j.server.rest.repr.MappingSerializer.putList(MappingSerializer.java:61)
    at org.neo4j.server.rest.repr.ListRepresentation.putTo(ListRepresentation.java:73)
    at org.neo4j.server.rest.repr.ObjectRepresentation$PropertyGetter.putTo(ObjectRepresentation.java:133)
    at org.neo4j.server.rest.repr.ObjectRepresentation.serialize(ObjectRepresentation.java:144)
    at org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:40)
    at org.neo4j.server.rest.repr.ListSerializer.addMapping(ListSerializer.java:56)
    at org.neo4j.server.rest.repr.MappingRepresentation.addTo(MappingRepresentation.java:52)
    at org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:60)
    at org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:51)
    at org.neo4j.server.rest.repr.OutputFormat.format(OutputFormat.java:182)
    at org.neo4j.server.rest.repr.OutputFormat.formatRepresentation(OutputFormat.java:132)
    at org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:119)
    at org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:55)
    at org.neo4j.server.rest.web.RestfulGraphDatabase.traverse(RestfulGraphDatabase.java:1264)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Powered by Jetty://



















From: Michael Hunger [mailto:[email protected]]
Sent: Tuesday, January 08, 2013 7:58 PM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Could you do me a favor and try the following:

RestTraversalDescription td = createTraversalDescription(rps);
Map map = td.getPostData();
System.out.println(org.neo4j.rest.graphdb.JsonHelper.createJsonFrom(map)); // put it into the file data.json

RestNode start = ...
System.out.println(start.getUri()+"/traverse/fullpath") // URI

curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

and see how much data is returned?

You can also execute the request in java using HttpConnection but it is more effort to do.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKNkqX9WWzoXs61yq2s5DanFA2keXajXb4Z_ScD1mWJSE.gif

from java-rest-binding.

 avatar commented on August 14, 2024

attached data.json

From: Michael Hunger [mailto:[email protected]]
Sent: Tuesday, January 08, 2013 7:58 PM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Could you do me a favor and try the following:

RestTraversalDescription td = createTraversalDescription(rps);
Map map = td.getPostData();
System.out.println(org.neo4j.rest.graphdb.JsonHelper.createJsonFrom(map)); // put it into the file data.json

RestNode start = ...
System.out.println(start.getUri()+"/traverse/fullpath") // URI

curl -X POST -d @data.json -H accept:application/json -H content-type:application/json URI

and see how much data is returned?

You can also execute the request in java using HttpConnection but it is more effort to do.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKNkqX9WWzoXs61yq2s5DanFA2keXajXb4Z_ScD1mWJSE.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Your attachment didn't make it. Perhaps you can send it to me directly, check the Neo4j google group.

Also how much memory does your server have?

And can you run these two:

this one streams the results

curl -X POST -d @data.json -H X-Stream:true -H accept:application/json -H content-type:application/json http://milona-16.int.westgroup.com:7474/db/data/node/141995/traverse/fullpath

and this which generates a smaller result:

curl -X POST -d @data.json -H X-Stream:true -H accept:application/json -H content-type:application/json http://milona-16.int.westgroup.com:7474/db/data/node/141995/traverse/node

from java-rest-binding.

 avatar commented on August 14, 2024

MIchael,

first off, thanks for your help with this, .. I know you must be busy & I appreciate it.

I‘ve been able to use the following query to achieve the results that I need … where the relationship types and length of the path are specified @ runtime.

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

                 query += "MATCH p = person1-[:HasGraduatedFrom|IsDirector|IsOfficer*..4]-person2 ";

                 query += "RETURN p";



                 Map<String, Object> parameters = new HashMap<String, Object>();

                 parameters.put("id1", rps.getPerson1PermId());

                 parameters.put("id2", rps.getPerson2PermId());

Thanks.

You still want me to run the other queries you provided ?

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 7:56 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Your attachment didn't make it. Perhaps you can send it to me directly, check the Neo4j google group.

Also how much memory does your server have?

And can you run these two:

this one streams the results

curl -X POST -d @data.json -H X-Stream:true -H accept:application/json -H content-type:application/json http://milona-16.int.westgroup.com:7474/db/data/node/141995/traverse/fullpath

and this which generates a smaller result:

curl -X POST -d @data.json -H X-Stream:true -H accept:application/json -H content-type:application/json http://milona-16.int.westgroup.com:7474/db/data/node/141995/traverse/node


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Yes that would still be great. Or you put the data.json into the issue as text. Then I can run them myself :)

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Yes that would be great ! Just to see / show how large a datafile it will become :)

from java-rest-binding.

 avatar commented on August 14, 2024

{

"order" : "depth_first",

"relationships" : [ {

"direction" : "all",

"type" : "IsUnknownSellSideBuySideAt"

}, {

"direction" : "all",

"type" : "IsUnknownResearchAnalystAt"

}, {

"direction" : "all",

"type" : "IsUnknownOfficerDirectorAt"

}, {

"direction" : "all",

"type" : "IsUnknownInsiderAt"

}, {

"direction" : "all",

"type" : "IsUnknownStreetEventsUserAt"

}, {

"direction" : "all",

"type" : "IsTraderAt"

}, {

"direction" : "all",

"type" : "IsSpeakingLanguageOf"

}, {

"direction" : "all",

"type" : "IsOfficer"

}, {

"direction" : "all",

"type" : "IsDirectorOfResearchAt"

}, {

"direction" : "all",

"type" : "IsMemberOrChairmanOf"

}, {

"direction" : "all",

"type" : "IsNonExecutiveAt"

}, {

"direction" : "all",

"type" : "IsProvidingResearchOn"

}, {

"direction" : "all",

"type" : "IsProvidingGeographyCoverageOf"

}, {

"direction" : "all",

"type" : "IsPortfolioManagerAt"

}, {

"direction" : "all",

"type" : "IsShariahSupervisoryAt"

}, {

"direction" : "all",

"type" : "IsDirector"

}, {

"direction" : "all",

"type" : "IsAnalystAt"

}, {

"direction" : "all",

"type" : "HasGraduatedFrom"

}, {

"direction" : "all",

"type" : "IsStrategistAt"

}, {

"direction" : "all",

"type" : "IsReuterMessengerUserAt"

}, {

"direction" : "all",

"type" : "IsExecutiveOfficerAt"

}, {

"direction" : "all",

"type" : "IsSalesProfessionalAt"

}, {

"direction" : "all",

"type" : "IsProvidingAssetClassCoverageOn"

}, {

"direction" : "all",

"type" : "IsVEExecutive"

}, {

"direction" : "all",

"type" : "IsUnknownVEExecutiveAt"

}, {

"direction" : "all",

"type" : "IsEconomistAt"

}, {

"direction" : "all",

"type" : "IsUnknownReutersMessengerUserAt"

}, {

"direction" : "all",

"type" : "IsChiefInvestmentOfficerAt"

} ],

"max_depth" : 4

}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:28 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would still be great. Or you put the data.json into the issue as text. Then I can run them myself :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

from java-rest-binding.

 avatar commented on August 14, 2024

Well, .. almost … is there a way to push these relationships types into the query @ runtime?

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

          query += "MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )";

          query += "RETURN p";



          Map<String, Object> parameters = new HashMap<String, Object>();

          parameters.put("id1", rps.getPerson1PermId());

          parameters.put("id2", rps.getPerson2PermId());

          parameters.put("r", "HasGraduatedFrom|IsDirector|IsOfficer");

          parameters.put("length", "4");



          Map<?,?> result = API.query(query, parameters);

results in …

{message=string matching regex (|[^])*' expected but `{' found

Think we should have better error message here? Help us by sending this query to [email protected].

Thank you, the Neo4j Team.

"START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )RETURN p"

                                                                                                       ^, exception=SyntaxException, stacktrace=[org.neo4j.cypher.internal.parser.v1_9.CypherParserImpl.parse(CypherParserImpl.scala:47), org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:37), org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58), org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66), org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:67), java.lang.reflect.Method.invoke(Method.java:600)]}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:29 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would be great ! Just to see / show how large a datafile it will become :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

Not yet it is planned

Sent from mobile device

Am 09.01.2013 um 16:18 schrieb blkdog [email protected]:

Well, .. almost … is there a way to push these relationships types into the query @ runtime?

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

query += "MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )";

query += "RETURN p";

Map<String, Object> parameters = new HashMap<String, Object>();

parameters.put("id1", rps.getPerson1PermId());

parameters.put("id2", rps.getPerson2PermId());

parameters.put("r", "HasGraduatedFrom|IsDirector|IsOfficer");

parameters.put("length", "4");

Map result = API.query(query, parameters);

results in …

{message=string matching regex (|[^])*' expected but `{' found

Think we should have better error message here? Help us by sending this query to [email protected].

Thank you, the Neo4j Team.

"START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )RETURN p"

^, exception=SyntaxException, stacktrace=[org.neo4j.cypher.internal.parser.v1_9.CypherParserImpl.parse(CypherParserImpl.scala:47), org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:37), org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58), org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66), org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:67), java.lang.reflect.Method.invoke(Method.java:600)]}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:29 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would be great ! Just to see / show how large a datafile it will become :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

Reply to this email directly or view it on GitHub.

from java-rest-binding.

 avatar commented on August 14, 2024

NOOOOOOOOOO …

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 10:42 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Not yet it is planned

Sent from mobile device

Am 09.01.2013 um 16:18 schrieb blkdog [email protected]:

Well, .. almost … is there a way to push these relationships types into the query @ runtime?

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

query += "MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )";

query += "RETURN p";

Map<String, Object> parameters = new HashMap<String, Object>();

parameters.put("id1", rps.getPerson1PermId());

parameters.put("id2", rps.getPerson2PermId());

parameters.put("r", "HasGraduatedFrom|IsDirector|IsOfficer");

parameters.put("length", "4");

Map result = API.query(query, parameters);

results in …

{message=string matching regex (|[^])*' expected but `{' found

Think we should have better error message here? Help us by sending this query to [email protected].

Thank you, the Neo4j Team.

"START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )RETURN p"

^, exception=SyntaxException, stacktrace=[org.neo4j.cypher.internal.parser.v1_9.CypherParserImpl.parse(CypherParserImpl.scala:47), org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:37), org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58), org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66), org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:67), java.lang.reflect.Method.invoke(Method.java:600)]}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:29 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would be great ! Just to see / show how large a datafile it will become :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/J6T91GIPIyhU-8ti4GCGP27iPrVu26U4ZoXvNjdEsXn02NLt3f4VF-PBgg2mYKnY.gif

from java-rest-binding.

jexp avatar jexp commented on August 14, 2024

But you can construct a appropriate query per combination

Sent from mobile device

Am 09.01.2013 um 16:54 schrieb blkdog [email protected]:

NOOOOOOOOOO …

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 10:42 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Not yet it is planned

Sent from mobile device

Am 09.01.2013 um 16:18 schrieb blkdog [email protected]:

Well, .. almost … is there a way to push these relationships types into the query @ runtime?

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

query += "MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )";

query += "RETURN p";

Map<String, Object> parameters = new HashMap<String, Object>();

parameters.put("id1", rps.getPerson1PermId());

parameters.put("id2", rps.getPerson2PermId());

parameters.put("r", "HasGraduatedFrom|IsDirector|IsOfficer");

parameters.put("length", "4");

Map result = API.query(query, parameters);

results in …

{message=string matching regex (|[^])*' expected but `{' found

Think we should have better error message here? Help us by sending this query to [email protected].

Thank you, the Neo4j Team.

"START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )RETURN p"

^, exception=SyntaxException, stacktrace=[org.neo4j.cypher.internal.parser.v1_9.CypherParserImpl.parse(CypherParserImpl.scala:47), org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:37), org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58), org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66), org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:67), java.lang.reflect.Method.invoke(Method.java:600)]}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:29 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would be great ! Just to see / show how large a datafile it will become :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/J6T91GIPIyhU-8ti4GCGP27iPrVu26U4ZoXvNjdEsXn02NLt3f4VF-PBgg2mYKnY.gif

Reply to this email directly or view it on GitHub.

from java-rest-binding.

 avatar commented on August 14, 2024

Workaround:

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

          query += "MATCH p = allShortestPaths(person1-[:##RELATIONS##*..4]-person2) ";

          query += "RETURN p";



          Map<String, Object> parameters = new HashMap<String, Object>();

          parameters.put("id1", rps.getPerson1PermId());

          parameters.put("id2", rps.getPerson2PermId());

          query = query.replaceAll("##RELATIONS##", "HasGraduatedFrom|IsDirector|IsOfficer");



          Map<?,?> result = API.query(query, parameters);

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 11:10 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

But you can construct a appropriate query per combination

Sent from mobile device

Am 09.01.2013 um 16:54 schrieb blkdog [email protected]:

NOOOOOOOOOO …

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 10:42 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Not yet it is planned

Sent from mobile device

Am 09.01.2013 um 16:18 schrieb blkdog [email protected]:

Well, .. almost … is there a way to push these relationships types into the query @ runtime?

String query = "START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) ";

query += "MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )";

query += "RETURN p";

Map<String, Object> parameters = new HashMap<String, Object>();

parameters.put("id1", rps.getPerson1PermId());

parameters.put("id2", rps.getPerson2PermId());

parameters.put("r", "HasGraduatedFrom|IsDirector|IsOfficer");

parameters.put("length", "4");

Map result = API.query(query, parameters);

results in …

{message=string matching regex (|[^])*' expected but `{' found

Think we should have better error message here? Help us by sending this query to [email protected].

Thank you, the Neo4j Team.

"START person1=node:PERSON(KEY={id1}),person2=node:PERSON(KEY={id2}) MATCH p = allShortestPaths( person1-[:{r}*..{length}]-person2 )RETURN p"

^, exception=SyntaxException, stacktrace=[org.neo4j.cypher.internal.parser.v1_9.CypherParserImpl.parse(CypherParserImpl.scala:47), org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine$$anonfun$prepare$1.apply(ExecutionEngine.scala:62), org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:37), org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:62), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55), org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58), org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:66), org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:67), java.lang.reflect.Method.invoke(Method.java:600)]}

From: Michael Hunger [mailto:[email protected]]
Sent: Wednesday, January 09, 2013 9:29 AM
To: neo4j/java-rest-binding
Cc: blkdog
Subject: Re: [java-rest-binding] Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); (#32)

Yes that would be great ! Just to see / show how large a datafile it will become :)


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/J6T91GIPIyhU-8ti4GCGP27iPrVu26U4ZoXvNjdEsXn02NLt3f4VF-PBgg2mYKnY.gif

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub #32 (comment) .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif

from java-rest-binding.

Related Issues (20)

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.