neo4j-contrib / java-rest-binding

Java Bindings for the Neo4J Server REST API, providing an implementation of GraphDatabaseService
Other
120 stars 72 forks source link

Neo4j - Java Heap Space Error - TraversalDescription.traverse(Node); #32

Closed ghost closed 10 years ago

ghost commented 11 years ago

If maxDepth is 3 code runs fine, if maxDepth = 4 this code hangs @ the call to td.traverse(start) (~line 38) & then I get:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515) at java.lang.StringBuilder.append(StringBuilder.java:189) at com.sun.jersey.core.util.ReaderWriter.readFromAsString(ReaderWriter.java:172) at com.sun.jersey.core.util.ReaderWriter.readFromAsString(ReaderWriter.java:157) at com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.readFromAsString(AbstractMessageReaderWriterProvider.java:114) at com.sun.jersey.core.impl.provider.entity.StringProvider.readFrom(StringProvider.java:73) at com.sun.jersey.core.impl.provider.entity.StringProvider.readFrom(StringProvider.java:58) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:552) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:505) at org.neo4j.rest.graphdb.RequestResult.extractFrom(RequestResult.java:87) at org.neo4j.rest.graphdb.ExecutingRestRequest.post(ExecutingRestRequest.java:138) at org.neo4j.rest.graphdb.ExecutingRestAPI.traverse(ExecutingRestAPI.java:486) at org.neo4j.rest.graphdb.RestAPIFacade.traverse(RestAPIFacade.java:202) at org.neo4j.rest.graphdb.traversal.RestTraversal.traverse(RestTraversal.java:162) at com.tr.cmg.alloy.dao.psd.RelationalPathSearchDAO.executeRelationalPathSearch(RelationalPathSearchDAO.java:38) at com.tr.cmg.alloy.dao.psd.RelationalPathSearchDAO.main(RelationalPathSearchDAO.java:115)

code ...

package com.tr.cmg.alloy.dao.psd;

import java.util.ArrayList;

import org.neo4j.graphdb.Direction; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Path; import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.traversal.TraversalDescription; import org.neo4j.rest.graphdb.index.RestIndex; import org.neo4j.rest.graphdb.traversal.RestTraversalDescription;

import com.tr.cmg.alloy.aspects.audit.DaoTierAuditAspect; import com.tr.cmg.alloy.dao.psd.relationship.RelationType; import com.tr.cmg.alloy.dao.support.neo4j.Neo4jDaoSupport; import com.tr.cmg.alloy.domain.psd.NodeType; import com.tr.cmg.alloy.services.psd.rps.RelationalPathSearch; import com.tr.cmg.alloy.services.psd.rps.RelationalPathSearchResult;

public class RelationalPathSearchDAO extends Neo4jDaoSupport{

public RelationalPathSearchResult executeRelationalPathSearch( RelationalPathSearch rps) {

RestIndex<Node> personIndex = API.getIndex(NodeType.PERSON.name());

Node start = personIndex.get("KEY", rps.getPerson1PermId()).getSingle();
Node end = personIndex.get("KEY", rps.getPerson2PermId()).getSingle();

Iterable<Node> nodes = null;
Iterable<Relationship> relationships = null;

if (start != null && end != null) {

    TraversalDescription td = createTraversalDescription(rps);
    nodes = null;
    relationships = null;
    for (Path position : td.traverse(start)) {

        // Log audit record info
        DaoTierAuditAspect
                .storeSqlStatement("Relational Path Neo4j Query: "
                        + rps.getPerson1PermId() + " -> "
                        + rps.getPerson2PermId());
        DaoTierAuditAspect.storeSqlParameters("");

        System.out.println(position);

        if (position.endNode().equals(end)) {
            nodes = position.nodes();
            relationships = position.relationships();
            break;
        }
    }

    if(nodes == null) {
        ArrayList<Node> x = new ArrayList<Node>();
        x.add(start);
        x.add(end);
        nodes = x;
    }
}

return new RelationalPathSearchResult(nodes, relationships);

}

private TraversalDescription createTraversalDescription(RelationalPathSearch rps) {

RestTraversalDescription rtd = (RestTraversalDescription) API.createTraversalDescription();
rtd.maxDepth(4);

return  rtd
        .depthFirst()
        .relationships(RelationType.IsDirector, Direction.BOTH)
        .relationships(RelationType.HasGraduatedFrom, Direction.BOTH)
        .relationships(RelationType.IsOfficer, Direction.BOTH)
        .relationships(RelationType.IsUnknownOfficerDirectorAt, Direction.BOTH)
        .relationships(RelationType.IsInsiderAt, Direction.BOTH)
        .relationships(RelationType.IsEquityAnalystAt, Direction.BOTH)
        .relationships(RelationType.IsMemberOrChairmanOf, Direction.BOTH)
        .relationships(RelationType.IsChiefInvestmentOfficerAt, Direction.BOTH)
        .relationships(RelationType.IsDirectorOfResearchAt, Direction.BOTH)
        .relationships(RelationType.IsPortfolioManagerAt, Direction.BOTH)
        .relationships(RelationType.IsTraderAt, Direction.BOTH)
        .relationships(RelationType.IsEconomistAt, Direction.BOTH)
        .relationships(RelationType.IsSalesProfessionalAt, Direction.BOTH)
        .relationships(RelationType.IsStrategistAt, Direction.BOTH)
        .relationships(RelationType.IsExecutiveOfficerAt, Direction.BOTH)
        .relationships(RelationType.IsShariahSupervisoryAt, Direction.BOTH)
        .relationships(RelationType.IsNonExecutiveAt, Direction.BOTH)
        .relationships(RelationType.IsVEExecutive, Direction.BOTH)
        .relationships(RelationType.IsProvidingResearchOn, Direction.BOTH)
        .relationships(RelationType.IsAnalystAt, Direction.BOTH)
        .relationships(RelationType.IsReuterMessengerUserAt, Direction.BOTH)
        .relationships(RelationType.IsProvidingAssetClassCoverageOn, Direction.BOTH)
        .relationships(RelationType.IsSpeakingLanguageOf, Direction.BOTH)
        .relationships(RelationType.IsProvidingGeographyCoverageOf, Direction.BOTH)
        .relationships(RelationType.IsUnknownSellSideBuySideAt, Direction.BOTH)
        .relationships(RelationType.IsUnknownInsiderAt, Direction.BOTH)
        .relationships(RelationType.IsUnknownResearchAnalystAt, Direction.BOTH)
        .relationships(RelationType.IsUnknownVEExecutiveAt, Direction.BOTH)
        .relationships(RelationType.IsUnknownReutersMessengerUserAt, Direction.BOTH)
        .relationships(RelationType.IsUnknownStreetEventsUserAt, Direction.BOTH);

}

public static void main(String[] args) {

RelationalPathSearchDAO dao = new RelationalPathSearchDAO();

RelationalPathSearch rps = new RelationalPathSearch();
rps.setPerson1PermId("34414591164");
rps.setPerson2PermId("34414710307");

RelationalPathSearchResult result = dao.executeRelationalPathSearch(rps);
result.toJSON();

}

jexp commented 11 years ago

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 ?

ghost commented 11 years ago

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 -

robertd.martin@thomsonreuters.com

From: Michael Hunger [mailto:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12021585 .

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

ghost commented 11 years ago

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12021585 .

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

jexp commented 11 years ago

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

jexp commented 11 years ago

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.

ghost commented 11 years ago

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

On Jan 8, 2013, at 7:57 PM, "Michael Hunger" notifications@github.com<mailto:notifications@github.com> 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/neo4j/java-rest-binding/issues/32#issuecomment-12026345.

jexp commented 11 years ago

But it is AM, 2 AM here :)

ghost commented 11 years ago

getPostData() isn’t available from RestTraversalDescription

From: Michael Hunger [mailto:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12026345 .

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

jexp commented 11 years ago

Sorry, it is RestTraversal which just implements RestTraversalDescription.

ghost commented 11 years ago

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

Error 500 INTERNAL_SERVER_ERROR

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12026345 .

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

ghost commented 11 years ago

attached data.json

From: Michael Hunger [mailto:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12026345 .

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

jexp commented 11 years ago

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

ghost commented 11 years ago

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12043192 .

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

jexp commented 11 years ago

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

jexp commented 11 years ago

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

ghost commented 11 years ago

{

"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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046206 .

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

ghost commented 11 years ago

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 cypher@neo4j.org.

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046257 .

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

jexp commented 11 years ago

Not yet it is planned

Sent from mobile device

Am 09.01.2013 um 16:18 schrieb blkdog notifications@github.com:

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 cypher@neo4j.org.

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046257 .

https://github.com/notifications/beacon/KYSGMqFZPDZYPaAIBJfBAkFJyAP-HncSd58OAlxDbohErBi0coLwXPYZdVIcMvSz.gif — Reply to this email directly or view it on GitHub.

ghost commented 11 years ago

NOOOOOOOOOO …

From: Michael Hunger [mailto:notifications@github.com] 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 notifications@github.com:

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 cypher@neo4j.org.

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046257 .

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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12049735 .

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

jexp commented 11 years ago

But you can construct a appropriate query per combination

Sent from mobile device

Am 09.01.2013 um 16:54 schrieb blkdog notifications@github.com:

NOOOOOOOOOO …

From: Michael Hunger [mailto:notifications@github.com] 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 notifications@github.com:

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 cypher@neo4j.org.

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046257 .

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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12049735 .

https://github.com/notifications/beacon/J6T91GIPIyhU-8ti4GCGP27iPrVu26U4ZoXvNjdEsXn02NLt3f4VF-PBgg2mYKnY.gif — Reply to this email directly or view it on GitHub.

ghost commented 11 years ago

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:notifications@github.com] 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 notifications@github.com:

NOOOOOOOOOO …

From: Michael Hunger [mailto:notifications@github.com] 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 notifications@github.com:

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 cypher@neo4j.org.

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:notifications@github.com] 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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12046257 .

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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12049735 .

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 https://github.com/neo4j/java-rest-binding/issues/32#issuecomment-12051304 .

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