Re: [Neo4j] simple traverse of tree
I'm not fully aware of your domain layout, but maybe add this: .uniqueness( Uniqueness.RELATIONSHIP_GLOBAL ) to your traversal description. The default (NODE_GLOBAL) may end up hiding some of your nodes depending on your graph layout. 2011/4/5 Matěj Plch plchm...@fit.cvut.cz Well so lastRelationship() isnt the right one method I am looking for and I have to look for highest id manually. But I have problem that if I traverse in the way like Michael suggested: IteratorNode i = Traversal.description().relationships(RelationshipTypes.TICKET_QUEUE, Direction.BOTH).relationships(RelationshipTypes.TICKET_STATUS, Direction.BOTH). relationships(RelationshipTypes.TICKET_TIMETAKEN, Direction.BOTH). traverse(ticketNode).nodes().iterator(); The iterator gives me only 6 ancestors. But in Neoclipse I can see much more ancestor nodes which is right. Why this traverse gives me bad result? I need all nodes which are directly connected thought Relatioshiptypes TICKET_STATUS,TICKET_TIMETAKEN,TICKET_QUEUE with ticketNode... Dne 4.4.2011 13:59, Mattias Persson napsal(a): 2011/4/4 Matěj Plchplchm...@fit.cvut.cz Is it possible to use *Path.lastRelationship*() ? How does it take last Relationship? According to id, or how the graph is traversed? It returns the last relationships in the current path, i.e. where the traverser is a.t.m. So it already has a reference to it and just returns it. Dne 26.3.2011 19:35, Michael Hunger napsal(a): Sure, if the tree from your root node is just a cluster that is not connected anywhere else (with those 3 relationship-types) it should be as simple as. (Just written from my head, so please check the correct syntax). Traversal.description().relationship(T1,OUTGOING).relationship(T2,OUTGOING).relationship(T3,OUTGOING).traverse(rootNode); That returns an iterator of all paths going from your root node. You can limit the nodes with .uniqueness() and then add the path's (path.nodes()) to a set to collect all nodes. For getting the one with the highest id, you can use java.util.Collections.max(collection, new ComparatorNode(){}); How big is your tree? Something like that should be in Graph-Algo perhaps as subgraph or tree. HTH Michael Am 26.03.2011 um 19:26 schrieb Matěj Plch: Thank you for so fast answer. I will look at it. I have milestone tomorrow so dont have a lot of time=) and have never worked with Groovy. Well so there isnt any simple method how to do it in classic neo4j Java API? Dne 26.3.2011 19:16, Saikat Kanjilal napsal(a): You can do all of these things using gremlin and pipes. Check out github for more details. Sent from my iPhone On Mar 26, 2011, at 11:13 AM, Matěj Plchplchm...@fit.cvut.cz wrote: Hi, I have some graph and, part of it is a tree. I simple get root of this tree through id. How to simple tranverse only tree under this root node? From root goes three unique type relationship to three unique group type nodes. Under this three nodes are a lot of nodes. And I need to write a method which gives me all nodes under that group node. Second question is if its possible ho to get from this group noe with the highest id (last added). Matěj Plch ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] EmbeddedReadOnlyGraphDatabase workings
A refresh, i.e. clearing of caches can be performed by (API may change): readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache(); and you could maybe keep the default cache_type setting. That should do what you're asking for. 2011/4/5 David Montag david.mon...@neotechnology.com Alfredas, A solution based on EmbeddedReadOnlyGraphDatabase would not be able to benefit from caching, as each refresh of the view would have to clear the caches. You could possibly achieve the solution you want by setting the config parameter cache_type=none for the read-only instance. Then it should not cache anything and always read from disk or OS cache. This would however yield degraded performance if you repeatedly read the same data. If your processing could benefit from caching, then you're better off creating a new instance, or manually clearing the caches. Or going with the HA-based solution that Jim and Mattias outlined. David On Tue, Apr 5, 2011 at 9:36 AM, Alfredas Chmieliauskas al.fre...@gmail.comwrote: Yes. The read only client would query the db at time intervals. Alfredas On Tue, Apr 5, 2011 at 5:40 PM, David Montag david.mon...@neotechnology.com wrote: Alfredas, When you say watch, do you mean poll the graph at some interval? What would the read-only client do? Thanks, David On Tue, Apr 5, 2011 at 5:26 AM, Alfredas Chmieliauskas al.fre...@gmail.com wrote: Dear all, we have the following situation: - 1 client is writing to the embedded db (writer) - 1 client would like to watch that (read-only) is that possible with the EmbeddedReadOnlyGraphDatabase? Currently it seems that the read-only db does not see the updates from the writer since its creation. It there a way to force refresh besides creating a new instance? Also are there any other/better ways to do that (1 writer, 1 reader) without going into the server mode? Thanks a lot, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Happy to announce that the Spring Data Graph tutorial is live at cineasts.net
Hi, after releasing the RC1 I found some time to make the SDG tutorial app available at http://cineasts.net. The creation of this webapp is discussed in detail in the Spring Data Graph guidebook at: http://bit.ly/das-book So feel free to try it out, register, search for movies and rate them and see your friends recommendations. Please get back with any feedback you have. Thanks Michael ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] InvalidRecordException
This has been very thoroughly investigated, and still is being thoroughly investigated, since we have not been able to reproduce the problem at all. Any hints on what scenario this occurred in that you can provide would be immensely helpful. Cheers, Tobias On Tue, Apr 5, 2011 at 9:41 PM, Degrassi Francesco francesco.degra...@emaze.net wrote: Hello everyone. Was this issue investigated and, perhaps, solved ? We started experiencing the same today, on Neo 1.1 on CentOS 5 and couldn't manage to reproduce it reliably yet. I will attach a stacktrace and more info tomorrow, but wanted to know if there were any news on the issue. Thanks in advance Francesco Degrassi Il 10 marzo 2011 alle 21.58 Massimo Lusetti mluse...@gmail.com ha scritto: On Thu, Mar 10, 2011 at 6:11 PM, Axel Morgner a...@morgner.de wrote: Hi, I'm getting an InvalidRecordException org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Node[5] is neither firstNode[37781] nor secondNode[37782] for Relationship[188125] at org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getMoreRelationships(ReadTransaction.java:131) at org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$ReadOnlyResourceConnection.getMoreRelationships(NioNeoDbPersistenceSource.java:280) at org.neo4j.kernel.impl.persistence.PersistenceManager.getMoreRelationships(PersistenceManager.java:100) at org.neo4j.kernel.impl.core.NodeManager.getMoreRelationships(NodeManager.java:585) at org.neo4j.kernel.impl.core.NodeImpl.getMoreRelationships(NodeImpl.java:358) at org.neo4j.kernel.impl.core.IntArrayIterator.hasNext(IntArrayIterator.java:115) when iterating through the relationships of a certain node: Node node = graphDb.getNodeById(sNode.getId()); IterableRelationship rels = node.getRelationships(relType, dir); for (Relationship r : rels) { - here the expeption occurs ... } I'm using 1.3.M03. Seems that the database is in an inconsitant state. Don't know how this could happen ... Greetings Axel ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user I'm encountering this same/similar exception quite ofter lately, with the same 1.3.M03 version, on FreeBSD 8.2 with OpenJDK Runtime Environment (build 1.6.0-b21) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode): org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Record[4130751] not in use at org.neo4j.kernel.impl.nioneo.store.RelationshipStore.getRecord(RelationshipStore.java:194) at org.neo4j.kernel.impl.nioneo.store.RelationshipStore.getRecord(RelationshipStore.java:96) at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.connectRelationship(WriteTransaction.java:1435) at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relationshipCreate(WriteTransaction.java:1389) at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaConnection$RelationshipEventConsumerImpl.createRelationship(NeoStoreXaConnection.java:256) at org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$NioNeoDbResourceConnection.relationshipCreate(NioNeoDbPersistenceSource.java:370) at org.neo4j.kernel.impl.persistence.PersistenceManager.relationshipCreate(PersistenceManager.java:153) at org.neo4j.kernel.impl.core.NodeManager.createRelationship(NodeManager.java:309) at org.neo4j.kernel.impl.core.NodeImpl.createRelationshipTo(NodeImpl.java:387) at org.neo4j.kernel.impl.core.NodeProxy.createRelationshipTo(NodeProxy.java:186) Did it rings and alert bell!? Cheers -- Massimo http://meridio.blogspot.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Getting JSON for a Representation in an unmanaged extension
Hello, I am currently working an an unamanged extension for the neo4j rest server. I want to provide an HTML response which includes the JSON String of a Representation. How can I get the OutputFormat for MediaType.APPLICATION_JSON in a method with @Produces(MediaType.TEXT_HTML)? Thanks in advice for your help. Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Getting JSON for a Representation in an unmanaged extension
I think the output format (repository) is also added to jerseys injection facilities. so you might try to get it injected with @Context OutputFormat, but I don't know if that works. Otherwise you might perhaps create your own instance of RepresentationFormatRepository with an injected server. (and use its server.getExtensionManager) (or in the worst case have ResourceConfig injected and iterate through its getSingletons to find the OutputFormatProvider.) Cheers Michael from NeoServletContainer, protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) { super.configure(wc, rc, wa); SetObject singletons = rc.getSingletons(); singletons.add( new DatabaseProvider( server.getDatabase() ) ); singletons.add( new GraphDatabaseServiceProvider( server.getDatabase().graph ) ); singletons.add( new NeoServerProvider( server ) ); singletons.add( new ConfigurationProvider( server.getConfiguration() ) ); if(server.getDatabase().rrdDb() != null) { singletons.add( new RrdDbProvider( server.getDatabase().rrdDb() ) ); } RepresentationFormatRepository repository = new RepresentationFormatRepository(server.getExtensionManager()); singletons.add( new InputFormatProvider( repository ) ); singletons.add( new OutputFormatProvider( repository ) ); } Am 06.04.2011 um 13:42 schrieb Dario Rexin: Hello, I am currently working an an unamanged extension for the neo4j rest server. I want to provide an HTML response which includes the JSON String of a Representation. How can I get the OutputFormat for MediaType.APPLICATION_JSON in a method with @Produces(MediaType.TEXT_HTML)? Thanks in advice for your help. Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Getting JSON for a Representation in an unmanaged extension
Hi, thank you very much. The server injection worked quiet well. Am 06.04.11 14:31 schrieb Michael Hunger unter michael.hun...@neotechnology.com: I think the output format (repository) is also added to jerseys injection facilities. so you might try to get it injected with @Context OutputFormat, but I don't know if that works. Otherwise you might perhaps create your own instance of RepresentationFormatRepository with an injected server. (and use its server.getExtensionManager) (or in the worst case have ResourceConfig injected and iterate through its getSingletons to find the OutputFormatProvider.) Cheers Michael from NeoServletContainer, protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) { super.configure(wc, rc, wa); SetObject singletons = rc.getSingletons(); singletons.add( new DatabaseProvider( server.getDatabase() ) ); singletons.add( new GraphDatabaseServiceProvider( server.getDatabase().graph ) ); singletons.add( new NeoServerProvider( server ) ); singletons.add( new ConfigurationProvider( server.getConfiguration() ) ); if(server.getDatabase().rrdDb() != null) { singletons.add( new RrdDbProvider( server.getDatabase().rrdDb() ) ); } RepresentationFormatRepository repository = new RepresentationFormatRepository(server.getExtensionManager()); singletons.add( new InputFormatProvider( repository ) ); singletons.add( new OutputFormatProvider( repository ) ); } Am 06.04.2011 um 13:42 schrieb Dario Rexin: Hello, I am currently working an an unamanged extension for the neo4j rest server. I want to provide an HTML response which includes the JSON String of a Representation. How can I get the OutputFormat for MediaType.APPLICATION_JSON in a method with @Produces(MediaType.TEXT_HTML)? Thanks in advice for your help. Cheers, Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] EmbeddedReadOnlyGraphDatabase workings
Hey, Thanks for the ideas. Both readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache() and cache_type=none worked. But I've run into some issues down the road. To test i've taken the same db folder with some nodes, properties and relations and created a read-only embedded db with it; later the same folder for standard embedded db. When opening the db as read-only: 1) node.getRelationships() is empty for all nodes whereas it is not the case in the standard mode 2) node.getPropertyKeys() sometimes throws org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Position[63] requested for operation is high id[24], store is ok[true] org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.acquireWindow(CommonAbstractStore.java:521) org.neo4j.kernel.impl.nioneo.store.AbstractDynamicStore.getLightRecords(AbstractDynamicStore.java:425) org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore.getRecord(PropertyIndexStore.java:196) org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getPropertyIndex(ReadTransaction.java:201) org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$ReadOnlyResourceConnection.loadIndex(NioNeoDbPersistenceSource.java:206) org.neo4j.kernel.impl.persistence.PersistenceManager.loadIndex(PersistenceManager.java:84) org.neo4j.kernel.impl.core.PropertyIndexManager.getIndexFor(PropertyIndexManager.java:141) org.neo4j.kernel.impl.core.NodeManager.getIndexFor(NodeManager.java:765) org.neo4j.kernel.impl.core.Primitive.getPropertyKeys(Primitive.java:117) org.neo4j.kernel.impl.core.NodeProxy.getPropertyKeys(NodeProxy.java:129) which works fine in the standard mode. I wonder am I doing something wrong or are these issues known? Alfredas On Wed, Apr 6, 2011 at 9:18 AM, Mattias Persson matt...@neotechnology.com wrote: A refresh, i.e. clearing of caches can be performed by (API may change): readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache(); and you could maybe keep the default cache_type setting. That should do what you're asking for. 2011/4/5 David Montag david.mon...@neotechnology.com Alfredas, A solution based on EmbeddedReadOnlyGraphDatabase would not be able to benefit from caching, as each refresh of the view would have to clear the caches. You could possibly achieve the solution you want by setting the config parameter cache_type=none for the read-only instance. Then it should not cache anything and always read from disk or OS cache. This would however yield degraded performance if you repeatedly read the same data. If your processing could benefit from caching, then you're better off creating a new instance, or manually clearing the caches. Or going with the HA-based solution that Jim and Mattias outlined. David On Tue, Apr 5, 2011 at 9:36 AM, Alfredas Chmieliauskas al.fre...@gmail.comwrote: Yes. The read only client would query the db at time intervals. Alfredas On Tue, Apr 5, 2011 at 5:40 PM, David Montag david.mon...@neotechnology.com wrote: Alfredas, When you say watch, do you mean poll the graph at some interval? What would the read-only client do? Thanks, David On Tue, Apr 5, 2011 at 5:26 AM, Alfredas Chmieliauskas al.fre...@gmail.com wrote: Dear all, we have the following situation: - 1 client is writing to the embedded db (writer) - 1 client would like to watch that (read-only) is that possible with the EmbeddedReadOnlyGraphDatabase? Currently it seems that the read-only db does not see the updates from the writer since its creation. It there a way to force refresh besides creating a new instance? Also are there any other/better ways to do that (1 writer, 1 reader) without going into the server mode? Thanks a lot, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] EmbeddedReadOnlyGraphDatabase workings
That is to be expected. It is due to cache staleness issues in the ReadOnly instance. Using cache_type=none should give the lowest probability of these things happening, but there are no guarantees. -t 2011/4/6 Alfredas Chmieliauskas al.fre...@gmail.com Hey, Thanks for the ideas. Both readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache() and cache_type=none worked. But I've run into some issues down the road. To test i've taken the same db folder with some nodes, properties and relations and created a read-only embedded db with it; later the same folder for standard embedded db. When opening the db as read-only: 1) node.getRelationships() is empty for all nodes whereas it is not the case in the standard mode 2) node.getPropertyKeys() sometimes throws org.neo4j.kernel.impl.nioneo.store.InvalidRecordException: Position[63] requested for operation is high id[24], store is ok[true] org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.acquireWindow(CommonAbstractStore.java:521) org.neo4j.kernel.impl.nioneo.store.AbstractDynamicStore.getLightRecords(AbstractDynamicStore.java:425) org.neo4j.kernel.impl.nioneo.store.PropertyIndexStore.getRecord(PropertyIndexStore.java:196) org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.getPropertyIndex(ReadTransaction.java:201) org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource$ReadOnlyResourceConnection.loadIndex(NioNeoDbPersistenceSource.java:206) org.neo4j.kernel.impl.persistence.PersistenceManager.loadIndex(PersistenceManager.java:84) org.neo4j.kernel.impl.core.PropertyIndexManager.getIndexFor(PropertyIndexManager.java:141) org.neo4j.kernel.impl.core.NodeManager.getIndexFor(NodeManager.java:765) org.neo4j.kernel.impl.core.Primitive.getPropertyKeys(Primitive.java:117) org.neo4j.kernel.impl.core.NodeProxy.getPropertyKeys(NodeProxy.java:129) which works fine in the standard mode. I wonder am I doing something wrong or are these issues known? Alfredas On Wed, Apr 6, 2011 at 9:18 AM, Mattias Persson matt...@neotechnology.com wrote: A refresh, i.e. clearing of caches can be performed by (API may change): readOnlyGraphDb.getConfig().getGraphDbModule().getNodeManager().clearCache(); and you could maybe keep the default cache_type setting. That should do what you're asking for. 2011/4/5 David Montag david.mon...@neotechnology.com Alfredas, A solution based on EmbeddedReadOnlyGraphDatabase would not be able to benefit from caching, as each refresh of the view would have to clear the caches. You could possibly achieve the solution you want by setting the config parameter cache_type=none for the read-only instance. Then it should not cache anything and always read from disk or OS cache. This would however yield degraded performance if you repeatedly read the same data. If your processing could benefit from caching, then you're better off creating a new instance, or manually clearing the caches. Or going with the HA-based solution that Jim and Mattias outlined. David On Tue, Apr 5, 2011 at 9:36 AM, Alfredas Chmieliauskas al.fre...@gmail.comwrote: Yes. The read only client would query the db at time intervals. Alfredas On Tue, Apr 5, 2011 at 5:40 PM, David Montag david.mon...@neotechnology.com wrote: Alfredas, When you say watch, do you mean poll the graph at some interval? What would the read-only client do? Thanks, David On Tue, Apr 5, 2011 at 5:26 AM, Alfredas Chmieliauskas al.fre...@gmail.com wrote: Dear all, we have the following situation: - 1 client is writing to the embedded db (writer) - 1 client would like to watch that (read-only) is that possible with the EmbeddedReadOnlyGraphDatabase? Currently it seems that the read-only db does not see the updates from the writer since its creation. It there a way to force refresh besides creating a new instance? Also are there any other/better ways to do that (1 writer, 1 reader) without going into the server mode? Thanks a lot, Alfredas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag -- David Montag david.mon...@neotechnology.com Neo Technology, www.neotechnology.com Cell: 650.556.4411 Skype: ddmontag ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo4j mailing list User@lists.neo4j.org
[Neo4j] Constructing an evaluator that only takes specific nodes from a path
Hello, we are trying to construct an Evaluator that will select only one node from the middle of a path and include it in the result. We do have a specific path we are looking for and the endNode is stored in 'end'. Now what we would like to do is have an Evaluator like this: import org.neo4j.graphdb.traversal. Evaluator; new Evaluator(){ @Override public Evaluation evaluate(org.neo4j.graphdb.Path path) { if(path.length() 3) { return Evaluation.EXCLUDE_AND_PRUNE; } else if (path.length() == 2) { return Evaluation.INCLUDE_AND_CONTINUE; } else if (path.length() 2){ return Evaluation.EXCLUDE_AND_CONTINUE; } else { return path.endNode().getId() == end.getId() ? Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE; } } } The decision on whether to accept or drop a path is based on wether we have reached the endNode. That's why we would like to use something like DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing? Any help appreciated! Thanks, Stephan and Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] simple traverse of tree
I had there an error... My fault. Your code is working fantastic. Thank you so much. I hope the last question: is it possible to add some parameter to exclude the start node? Dne 6.4.2011 09:13, Mattias Persson napsal(a): I'm not fully aware of your domain layout, but maybe add this: .uniqueness( Uniqueness.RELATIONSHIP_GLOBAL ) to your traversal description. The default (NODE_GLOBAL) may end up hiding some of your nodes depending on your graph layout. 2011/4/5 Matěj Plchplchm...@fit.cvut.cz Well so lastRelationship() isnt the right one method I am looking for and I have to look for highest id manually. But I have problem that if I traverse in the way like Michael suggested: IteratorNode i = Traversal.description().relationships(RelationshipTypes.TICKET_QUEUE, Direction.BOTH).relationships(RelationshipTypes.TICKET_STATUS, Direction.BOTH). relationships(RelationshipTypes.TICKET_TIMETAKEN, Direction.BOTH). traverse(ticketNode).nodes().iterator(); The iterator gives me only 6 ancestors. But in Neoclipse I can see much more ancestor nodes which is right. Why this traverse gives me bad result? I need all nodes which are directly connected thought Relatioshiptypes TICKET_STATUS,TICKET_TIMETAKEN,TICKET_QUEUE with ticketNode... Dne 4.4.2011 13:59, Mattias Persson napsal(a): 2011/4/4 Matěj Plchplchm...@fit.cvut.cz Is it possible to use *Path.lastRelationship*() ? How does it take last Relationship? According to id, or how the graph is traversed? It returns the last relationships in the current path, i.e. where the traverser is a.t.m. So it already has a reference to it and just returns it. Dne 26.3.2011 19:35, Michael Hunger napsal(a): Sure, if the tree from your root node is just a cluster that is not connected anywhere else (with those 3 relationship-types) it should be as simple as. (Just written from my head, so please check the correct syntax). Traversal.description().relationship(T1,OUTGOING).relationship(T2,OUTGOING).relationship(T3,OUTGOING).traverse(rootNode); That returns an iterator of all paths going from your root node. You can limit the nodes with .uniqueness() and then add the path's (path.nodes()) to a set to collect all nodes. For getting the one with the highest id, you can use java.util.Collections.max(collection, new ComparatorNode(){}); How big is your tree? Something like that should be in Graph-Algo perhaps as subgraph or tree. HTH Michael Am 26.03.2011 um 19:26 schrieb Matěj Plch: Thank you for so fast answer. I will look at it. I have milestone tomorrow so dont have a lot of time=) and have never worked with Groovy. Well so there isnt any simple method how to do it in classic neo4j Java API? Dne 26.3.2011 19:16, Saikat Kanjilal napsal(a): You can do all of these things using gremlin and pipes. Check out github for more details. Sent from my iPhone On Mar 26, 2011, at 11:13 AM, Matěj Plchplchm...@fit.cvut.cz wrote: Hi, I have some graph and, part of it is a tree. I simple get root of this tree through id. How to simple tranverse only tree under this root node? From root goes three unique type relationship to three unique group type nodes. Under this three nodes are a lot of nodes. And I need to write a method which gives me all nodes under that group node. Second question is if its possible ho to get from this group noe with the highest id (last added). Matěj Plch ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] simple traverse of tree
sure ... .evaluator(Evalutators.excludeStartPosition()) ... Cheers Michael Am 06.04.2011 um 20:15 schrieb Matěj Plch: I had there an error... My fault. Your code is working fantastic. Thank you so much. I hope the last question: is it possible to add some parameter to exclude the start node? Dne 6.4.2011 09:13, Mattias Persson napsal(a): I'm not fully aware of your domain layout, but maybe add this: .uniqueness( Uniqueness.RELATIONSHIP_GLOBAL ) to your traversal description. The default (NODE_GLOBAL) may end up hiding some of your nodes depending on your graph layout. 2011/4/5 Matěj Plchplchm...@fit.cvut.cz Well so lastRelationship() isnt the right one method I am looking for and I have to look for highest id manually. But I have problem that if I traverse in the way like Michael suggested: IteratorNode i = Traversal.description().relationships(RelationshipTypes.TICKET_QUEUE, Direction.BOTH).relationships(RelationshipTypes.TICKET_STATUS, Direction.BOTH). relationships(RelationshipTypes.TICKET_TIMETAKEN, Direction.BOTH). traverse(ticketNode).nodes().iterator(); The iterator gives me only 6 ancestors. But in Neoclipse I can see much more ancestor nodes which is right. Why this traverse gives me bad result? I need all nodes which are directly connected thought Relatioshiptypes TICKET_STATUS,TICKET_TIMETAKEN,TICKET_QUEUE with ticketNode... Dne 4.4.2011 13:59, Mattias Persson napsal(a): 2011/4/4 Matěj Plchplchm...@fit.cvut.cz Is it possible to use *Path.lastRelationship*() ? How does it take last Relationship? According to id, or how the graph is traversed? It returns the last relationships in the current path, i.e. where the traverser is a.t.m. So it already has a reference to it and just returns it. Dne 26.3.2011 19:35, Michael Hunger napsal(a): Sure, if the tree from your root node is just a cluster that is not connected anywhere else (with those 3 relationship-types) it should be as simple as. (Just written from my head, so please check the correct syntax). Traversal.description().relationship(T1,OUTGOING).relationship(T2,OUTGOING).relationship(T3,OUTGOING).traverse(rootNode); That returns an iterator of all paths going from your root node. You can limit the nodes with .uniqueness() and then add the path's (path.nodes()) to a set to collect all nodes. For getting the one with the highest id, you can use java.util.Collections.max(collection, new ComparatorNode(){}); How big is your tree? Something like that should be in Graph-Algo perhaps as subgraph or tree. HTH Michael Am 26.03.2011 um 19:26 schrieb Matěj Plch: Thank you for so fast answer. I will look at it. I have milestone tomorrow so dont have a lot of time=) and have never worked with Groovy. Well so there isnt any simple method how to do it in classic neo4j Java API? Dne 26.3.2011 19:16, Saikat Kanjilal napsal(a): You can do all of these things using gremlin and pipes. Check out github for more details. Sent from my iPhone On Mar 26, 2011, at 11:13 AM, Matěj Plchplchm...@fit.cvut.cz wrote: Hi, I have some graph and, part of it is a tree. I simple get root of this tree through id. How to simple tranverse only tree under this root node? From root goes three unique type relationship to three unique group type nodes. Under this three nodes are a lot of nodes. And I need to write a method which gives me all nodes under that group node. Second question is if its possible ho to get from this group noe with the highest id (last added). Matěj Plch ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Loading quirky data into the graph
Hi fellow graph-heads, I'm writing a Neo4j tutorial with Ian Robinson, and although Neo4j is a joy to use (naturally!), we're coming up against all kinds of annoyances when loading data into the graph. Our data set (based on the Doctor Who universe) contains overlapping entries, disjoint data, duplicates and so on. I'm thinking of just writing a fluent Java interface or a DSL to handle the task of loading the graph, eg: Node gallifrey = planet(Gallifrey); Node tardis = vehicle(tardis); Node theDoctor = character(Doctor).species(timelord).from(gallifrey).travelsIn(tardis); Node earth = planet(Earth); character(Rose Tyler).species(human).companionOf(theDoctor).from(earth) ... Does anyone have better ideas? Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Loading quirky data into the graph
aka Nat Pryce's test data builders perhaps also a textual DSL like graphviz' dot language imho there are importers for that or use Andreas' ruby stuff this seems to be pretty natural too Cheers Michael Sent from my iBrick4 Am 06.04.2011 um 23:22 schrieb Jim Webber j...@neotechnology.com: Hi fellow graph-heads, I'm writing a Neo4j tutorial with Ian Robinson, and although Neo4j is a joy to use (naturally!), we're coming up against all kinds of annoyances when loading data into the graph. Our data set (based on the Doctor Who universe) contains overlapping entries, disjoint data, duplicates and so on. I'm thinking of just writing a fluent Java interface or a DSL to handle the task of loading the graph, eg: Node gallifrey = planet(Gallifrey); Node tardis = vehicle(tardis); Node theDoctor = character(Doctor).species(timelord).from(gallifrey).travelsIn(tardis); Node earth = planet(Earth); character(Rose Tyler).species(human).companionOf(theDoctor).from(earth) ... Does anyone have better ideas? Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Loading quirky data into the graph
https://github.com/andreasronge/neo4j Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Apr 6, 2011 at 11:35 PM, Michael Hunger michael.hun...@neotechnology.com wrote: aka Nat Pryce's test data builders perhaps also a textual DSL like graphviz' dot language imho there are importers for that or use Andreas' ruby stuff this seems to be pretty natural too Cheers Michael Sent from my iBrick4 Am 06.04.2011 um 23:22 schrieb Jim Webber j...@neotechnology.com: Hi fellow graph-heads, I'm writing a Neo4j tutorial with Ian Robinson, and although Neo4j is a joy to use (naturally!), we're coming up against all kinds of annoyances when loading data into the graph. Our data set (based on the Doctor Who universe) contains overlapping entries, disjoint data, duplicates and so on. I'm thinking of just writing a fluent Java interface or a DSL to handle the task of loading the graph, eg: Node gallifrey = planet(Gallifrey); Node tardis = vehicle(tardis); Node theDoctor = character(Doctor).species(timelord).from(gallifrey).travelsIn(tardis); Node earth = planet(Earth); character(Rose Tyler).species(human).companionOf(theDoctor).from(earth) ... Does anyone have better ideas? Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] simple traverse of tree
Just as a note (and as the javadoc says) you can have multiple evaluators in a traversal description. 2011/4/6 Michael Hunger michael.hun...@neotechnology.com: sure ... .evaluator(Evalutators.excludeStartPosition()) ... Cheers Michael Am 06.04.2011 um 20:15 schrieb Matěj Plch: I had there an error... My fault. Your code is working fantastic. Thank you so much. I hope the last question: is it possible to add some parameter to exclude the start node? Dne 6.4.2011 09:13, Mattias Persson napsal(a): I'm not fully aware of your domain layout, but maybe add this: .uniqueness( Uniqueness.RELATIONSHIP_GLOBAL ) to your traversal description. The default (NODE_GLOBAL) may end up hiding some of your nodes depending on your graph layout. 2011/4/5 Matěj Plchplchm...@fit.cvut.cz Well so lastRelationship() isnt the right one method I am looking for and I have to look for highest id manually. But I have problem that if I traverse in the way like Michael suggested: IteratorNode i = Traversal.description().relationships(RelationshipTypes.TICKET_QUEUE, Direction.BOTH).relationships(RelationshipTypes.TICKET_STATUS, Direction.BOTH). relationships(RelationshipTypes.TICKET_TIMETAKEN, Direction.BOTH). traverse(ticketNode).nodes().iterator(); The iterator gives me only 6 ancestors. But in Neoclipse I can see much more ancestor nodes which is right. Why this traverse gives me bad result? I need all nodes which are directly connected thought Relatioshiptypes TICKET_STATUS,TICKET_TIMETAKEN,TICKET_QUEUE with ticketNode... Dne 4.4.2011 13:59, Mattias Persson napsal(a): 2011/4/4 Matěj Plchplchm...@fit.cvut.cz Is it possible to use *Path.lastRelationship*() ? How does it take last Relationship? According to id, or how the graph is traversed? It returns the last relationships in the current path, i.e. where the traverser is a.t.m. So it already has a reference to it and just returns it. Dne 26.3.2011 19:35, Michael Hunger napsal(a): Sure, if the tree from your root node is just a cluster that is not connected anywhere else (with those 3 relationship-types) it should be as simple as. (Just written from my head, so please check the correct syntax). Traversal.description().relationship(T1,OUTGOING).relationship(T2,OUTGOING).relationship(T3,OUTGOING).traverse(rootNode); That returns an iterator of all paths going from your root node. You can limit the nodes with .uniqueness() and then add the path's (path.nodes()) to a set to collect all nodes. For getting the one with the highest id, you can use java.util.Collections.max(collection, new ComparatorNode(){}); How big is your tree? Something like that should be in Graph-Algo perhaps as subgraph or tree. HTH Michael Am 26.03.2011 um 19:26 schrieb Matěj Plch: Thank you for so fast answer. I will look at it. I have milestone tomorrow so dont have a lot of time=) and have never worked with Groovy. Well so there isnt any simple method how to do it in classic neo4j Java API? Dne 26.3.2011 19:16, Saikat Kanjilal napsal(a): You can do all of these things using gremlin and pipes. Check out github for more details. Sent from my iPhone On Mar 26, 2011, at 11:13 AM, Matěj Plchplchm...@fit.cvut.cz wrote: Hi, I have some graph and, part of it is a tree. I simple get root of this tree through id. How to simple tranverse only tree under this root node? From root goes three unique type relationship to three unique group type nodes. Under this three nodes are a lot of nodes. And I need to write a method which gives me all nodes under that group node. Second question is if its possible ho to get from this group noe with the highest id (last added). Matěj Plch ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com
[Neo4j] building from source
When building from source by running ./gradlew (under Ubuntu), it dies with the following error: * Where: Build file '/home/will/tip/lib/neo4j/graphdb/build.gradle' line: 19 * What went wrong: A problem occurred evaluating root project 'graphdb'. Cause: Plugin with id 'idea' not found. Upon commenting out the idea plugin, it dies with the error: * Where: Build file '/home/will/tip/lib/neo4j/graphdb/build.gradle' line: 24 * What went wrong: A problem occurred evaluating root project 'graphdb'. Cause: Could not find method mavenLocal() for arguments [] on resolver container. Once I downloaded the latest gradle from: http://repo.gradle.org/gradle/distributions/ I could get through the default task, but when I try the jar task it dies with 100 compilation errors. /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Cache.java:24: package org.neo4j.jmx does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/InstanceInfo.java:28: package org.neo4j.helpers does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Neo4jManager.java:50: package org.neo4j.jmx.impl does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Neo4jManager.java:51: package org.neo4j.kernel does not exist Maven will execute but there's no jar task. I looked a bit at the gradle config, but didn't see any immediate solutions. Anyone have any suggestions? -Will ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] How to trim first couple nodes from path in traversal framework?
Hi, I would like to fetch a ending portion of a path where the timestamp of the relationship match. for example: (Node 1)---2pm(Node 3)---3PM---(Node 4)4PM---(Node 64) from the above , I only want the subpath starting from Node 4 onward for the timestamp greater than 3:30PM How could I code evaluator to do it? Thanks in advance, Brendan ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Constructing an evaluator that only takes specific nodes from a path
Dario, I am not quite sure I understand what you mean by drop is that not to include the path into the result or prune or something else? Do you have a concrete example of this, maybe a simple toy graph test with toy information? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Apr 6, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hello, we are trying to construct an Evaluator that will select only one node from the middle of a path and include it in the result. We do have a specific path we are looking for and the endNode is stored in 'end'. Now what we would like to do is have an Evaluator like this: import org.neo4j.graphdb.traversal. Evaluator; new Evaluator(){ @Override public Evaluation evaluate(org.neo4j.graphdb.Path path) { if(path.length() 3) { return Evaluation.EXCLUDE_AND_PRUNE; } else if (path.length() == 2) { return Evaluation.INCLUDE_AND_CONTINUE; } else if (path.length() 2){ return Evaluation.EXCLUDE_AND_CONTINUE; } else { return path.endNode().getId() == end.getId() ? Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE; } } } The decision on whether to accept or drop a path is based on wether we have reached the endNode. That's why we would like to use something like DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing? Any help appreciated! Thanks, Stephan and Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] building from source
Willi, the main build tool is maven, and we are in the middle of a major reshuffling on GIT, so if you install maven.apache.org and try mvn clean install that, things should work out better. Would that be an option? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Thu, Apr 7, 2011 at 6:19 AM, Will Holcomb w...@dhappy.org wrote: When building from source by running ./gradlew (under Ubuntu), it dies with the following error: * Where: Build file '/home/will/tip/lib/neo4j/graphdb/build.gradle' line: 19 * What went wrong: A problem occurred evaluating root project 'graphdb'. Cause: Plugin with id 'idea' not found. Upon commenting out the idea plugin, it dies with the error: * Where: Build file '/home/will/tip/lib/neo4j/graphdb/build.gradle' line: 24 * What went wrong: A problem occurred evaluating root project 'graphdb'. Cause: Could not find method mavenLocal() for arguments [] on resolver container. Once I downloaded the latest gradle from: http://repo.gradle.org/gradle/distributions/ I could get through the default task, but when I try the jar task it dies with 100 compilation errors. /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Cache.java:24: package org.neo4j.jmx does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/InstanceInfo.java:28: package org.neo4j.helpers does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Neo4jManager.java:50: package org.neo4j.jmx.impl does not exist /home/will/tip/lib/neo4j/graphdb/management/src/main/java/org/neo4j/management/Neo4jManager.java:51: package org.neo4j.kernel does not exist Maven will execute but there's no jar task. I looked a bit at the gradle config, but didn't see any immediate solutions. Anyone have any suggestions? -Will ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to trim first couple nodes from path in traversal framework?
Hi Brendan, At least over REST API you could do something like this (untested code): return filter : { language : javascript, body : position.length() 0 position.lastRelationship().hasProperty('timestamp') position.lastRelationship().getProperty('timestamp') '1530' } About performance: if you need to do such a query very often, at least I would do some indexing to make it possible to start the traversal as close as possible. In general: find this kind of chronological, timestamped data series better to be stored in MySQL or similar for queries. Ok, Peter other guys from Neo, please correct me. ;) Ville 2011/4/7 Brendan Cheng ccp...@gmail.com: Hi, I would like to fetch a ending portion of a path where the timestamp of the relationship match. for example: (Node 1)---2pm(Node 3)---3PM---(Node 4)4PM---(Node 64) from the above , I only want the subpath starting from Node 4 onward for the timestamp greater than 3:30PM How could I code evaluator to do it? Thanks in advance, Brendan ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] CNFE in Neo4j Server
Hi there, trying to execute https://github.com/peterneubauer/neo4j-gremlin-plugin/blob/master/src/test/org/neo4j/server/plugin/gremlin/GremlinPluginTest.java as a JUnit test on Eclipse/Mac with default JDK, Saikat is getting the following: java.lang.ExceptionInInitializerError at org.neo4j.server.rest.repr.formats.JsonFormat.init(JsonFormat.java:43) at org.neo4j.server.plugin.gremlin.GremlinPluginTest.setUpBeforeClass(GremlinPluginTest.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122) at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91) at javax.ws.rs.core.MediaType.clinit(MediaType.java:44) ... 17 more Caused by: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62) at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155) at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105) ... 19 more Any clues on why there is a class missing? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Constructing an evaluator that only takes specific nodes from a path
Hi Peter, yes that would be not to include the path in the result set. On 07.04.2011, at 07:01, Peter Neubauer peter.neuba...@neotechnology.com wrote: Dario, I am not quite sure I understand what you mean by drop is that not to include the path into the result or prune or something else? Do you have a concrete example of this, maybe a simple toy graph test with toy information? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/- Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Apr 6, 2011 at 6:35 PM, Dario Rexin dario.re...@xing.com wrote: Hello, we are trying to construct an Evaluator that will select only one node from the middle of a path and include it in the result. We do have a specific path we are looking for and the endNode is stored in 'end'. Now what we would like to do is have an Evaluator like this: import org.neo4j.graphdb.traversal. Evaluator; new Evaluator(){ @Override public Evaluation evaluate(org.neo4j.graphdb.Path path) { if(path.length() 3) { return Evaluation.EXCLUDE_AND_PRUNE; } else if (path.length() == 2) { return Evaluation.INCLUDE_AND_CONTINUE; } else if (path.length() 2){ return Evaluation.EXCLUDE_AND_CONTINUE; } else { return path.endNode().getId() == end.getId() ? Evaluation.EXCLUDE_AND_PRUNE : Evaluation.DROP_PATH_AND_PRUNE; } } } The decision on whether to accept or drop a path is based on wether we have reached the endNode. That's why we would like to use something like DROP_PATH_AND_PRUNE, which doesn't exist. What are we missing? Any help appreciated! Thanks, Stephan and Dario ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user