Re: [Neo] Neo framework documentations...
On 6/28/07, Johan Svensson [EMAIL PROTECTED] wrote: On 6/28/07, Tobias Ivarsson [EMAIL PROTECTED] wrote: From the neo4j.org website: ... Neo provides: ... - an event framework with proactive and reactive events on modification of the node space. Actually, we haven't exposed the event framework yet in the new API. But we'll try to get that in the next (and final) beta. - a validator framework for expressing data integrity constraints. Same here but I also did a refactoring of this a few months back. I wasn't happy with how the NeoConstraintsValidator worked and basically wrote a new one using only the event framework. It should be possible to implement just about any type of data integrity constraint using the event framework (Neo is event driven) and since I wasn't happy with the current validator framework I removed it. We are however working on some new stuff for this (OWL based constraints validation). Yes, my intuition tells me that the event framework could be a great platform for implementing constraint systems. Perhaps the data integrity constraint validator framework should be published in a separate package. At least to start with. Especially if it hasn't reached a mature state yet. /Tobias ___ Neo mailing list User@lists.neo4j.org http://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo framework documentations...
On 6/28/07, Tobias Ivarsson [EMAIL PROTECTED] wrote: From the neo4j.org website: ... Neo provides: ... - an event framework with proactive and reactive events on modification of the node space. Actually, we haven't exposed the event framework yet in the new API. But we'll try to get that in the next (and final) beta. - a validator framework for expressing data integrity constraints. Same here but I also did a refactoring of this a few months back. I wasn't happy with how the NeoConstraintsValidator worked and basically wrote a new one using only the event framework. It should be possible to implement just about any type of data integrity constraint using the event framework (Neo is event driven) and since I wasn't happy with the current validator framework I removed it. We are however working on some new stuff for this (OWL based constraints validation). -Johan ___ Neo mailing list User@lists.neo4j.org http://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
Hi, having an event mechanism in Neo4j is definitly a good idea. Just two quick thoughts on that: * consider integration into Spring's event stuff: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#context-functionality-events * using the proactive handlers you mentioned, we might be able to introduce a kind of authorization management into neo4j. Regards, Stefan Tobias Ivarsson schrieb: Fellow developers! The time has come to start the work on an event framework for Neo4j. In order to do a good work at this we would get input on what requirements you have on an event framework. We would like to get a list of use cases for which you would use an event framework, along with the features you think the use case would need from the event framework (i.e. which events you would like to receive notification about, and when). We would also like you to motivate why these features are required by the use case. Events can easily degrade performance if the framework is ill designed, so we would like to keep things very lean. We have made some early analysis and arrived at the following conclusions: * There can be two kinds of event handlers: Proactive event handlers and Reactive event handlers. Proactive event handlers have the ability to preempt operations and Reactive event handlers simply react to an event and cannot cause the event to not succeed. * There are three kinds of events in Neo4j kernel: - Lifecycle events, such as shutdown. - Transactional events, such as start commit, commit successful, rollback, etc. - Data modification events, such as node created, property changed, relationship removed, etc. It might be possible that other components, such as the indexing component, would want to add more events to the event framework. These are of course just some initial input to get your thoughts going, feel free to think outside of the constraints above. Our ultimate goal is to create an event framework that is as useful as possible while maintaining ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
Event support is a great idea. Just in case people aren't aware of it, I've used the event bus project http://www.eventbus.org/ with great success in that past, for in VM events. Maybe something to avoid reinventing the wheel. Jonny ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
Based on the feedback we have received here we have created a draft of an API for an event framework. The semantics of the system that we have outlined are: * There are two kinds of events - Database Lifecycle Events and Transaction Events * The interesting Lifecycle events are: - before shutdown, to enable shutting down services cleanly that depend on the GraphDatabaseService - An event that gets triggered when the GraphDatabaseService has entered a state from which it cannot recover, we'ce called this event kernel panic. * We could identify another lifecycle event: after startup, but we couldn't find a case where an event handler could be installed when this event would be fired, since event handlers would be registered after the the GraphDatabaseService has been instantiated. * The minimal number of interesting Transaction events we have identified are: - before commit: invoked when a transaction is about to be committed. - after commit: invoked after the transaction has successfully been committed - after rollback: invoked if the transaction could not be committed, after it has been rolled back. * All Transactional events are synchronous, i.e. they are invoked in the same thread as the transaction is performed in. * The after commit and after rollback events are only invoked if before commit already been invoked. * The first argument of all Transactional event handling methods is an object that contains all the state that was modified during the transaction. * When before commit is invoked the transaction is still open, meaning that it would be possible to modify the graph as part of the handling of the event. There are however no guarantees that these modifications will be seen by other (and even the same) event handlers, therefore it is strongly discouraged to modify the graph during the handling of the event. The only guarantee is that the events will not be reissued, i.e. the event handlers will not be invoked again. * If the handling of before commit throws an exception (any exception) the transaction will fail and be rolled back, invoking the after rollback method of all the handlers that have had their before commit handler invoked, except for the handler that threw the exception. * If a transaction is marked for rollback [tx.failure()] before it is completed [tx.finish()], the Transaction event handler is never invoked (actually if the transaction is *not* marked as successful). * Since Transactional event handlers are used concurrently from multiple threads they should be stateless. In order to be able to carry state from the before commit event to the after commit or after rollback events, the before commit method may return an arbitrary object that will be passed as a second argument to the handler methods for after commit or after rollback. We have opted for only implementing synchronous pro-active bulk operation events since they can be used to emulate any other kind of events. This decision was made based on the input in this thread of using an existing event dispatch system. It is easy for the user to based on the events defined above fire off events through another event dispatch system. * Equivalent reactive asynchronous events are simple. * Reactive asynchronous events for each individual change that occurred could be constructed from the transaction change data that is passed to the event handler methods. * It would even be possible (but a bad idea) to fire of further synchronous events. The code of the API draft is available for checkout at: https://svn.neo4j.org/laboratory/components/event-framework/ A browsable version is available at: https://trac.neo4j.org/browser/laboratory/components/event-framework/src/main/java/org/neo4j/event/ Please let us know what you think! Cheers, -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
There certainly should be an onBeforeSuccess event, that can roll back the current transaction. I would like to maintain a graph that is guaranteed to be consistent with the MetaModel, so having a log of violations wouldn't be good enough. Kind regards, Niels Hoogeveen From: tobias.ivars...@neotechnology.com Date: Wed, 31 Mar 2010 14:43:24 +0200 To: user@lists.neo4j.org Subject: Re: [Neo] Requirements for an event framework for Neo4j Yes. I can tick of one of the use cases on my list of expected ones. I would like some more input on this though. I'm assuming that you would want proactive event handlers for building this. That would enable you to reject changes if the MetaModel validator doesn't accept them. Or would it be enough to be able to output a log message about there being a change that violated the validation? Cheers, Tobias On Wed, Mar 31, 2010 at 1:54 PM, Niels Hoogeveen pd_aficion...@hotmail.comwrote: A use case I have mentioned earlier on this list is a MetaModel validator. Such a component should be triggered on transaction success to validate the added/deleted relationships, nodes and properties, and the updated property values. It's an open question to me, whether every change event should be logged by the validator, or if the validator can somehow get a set of nodes/relationship/properties from Transaction with those entities that have been touched within that transaction. The nicest solution from my point of view would be that the onSuccess event has a property touchedNodes, which is a list of node facades, where only the immutable methods of Node are implemented, and where the return value of each method returns an immutable value. The book keeping with respect to transactions is already done within the transactions, so logging all changes once more for a validator seems a waste of cycles and memory. So, to me an event with a reference to this change log, would seem the nicest solution. Kind regards, Niels Hoogeveen From: tobias.ivars...@neotechnology.com Date: Wed, 31 Mar 2010 12:39:25 +0200 To: user@lists.neo4j.org Subject: [Neo] Requirements for an event framework for Neo4j Fellow developers! The time has come to start the work on an event framework for Neo4j. In order to do a good work at this we would get input on what requirements you have on an event framework. We would like to get a list of use cases for which you would use an event framework, along with the features you think the use case would need from the event framework (i.e. which events you would like to receive notification about, and when). We would also like you to motivate why these features are required by the use case. Events can easily degrade performance if the framework is ill designed, so we would like to keep things very lean. We have made some early analysis and arrived at the following conclusions: * There can be two kinds of event handlers: Proactive event handlers and Reactive event handlers. Proactive event handlers have the ability to preempt operations and Reactive event handlers simply react to an event and cannot cause the event to not succeed. * There are three kinds of events in Neo4j kernel: - Lifecycle events, such as shutdown. - Transactional events, such as start commit, commit successful, rollback, etc. - Data modification events, such as node created, property changed, relationship removed, etc. It might be possible that other components, such as the indexing component, would want to add more events to the event framework. These are of course just some initial input to get your thoughts going, feel free to think outside of the constraints above. Our ultimate goal is to create an event framework that is as useful as possible while maintaining -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ Express yourself instantly with MSN Messenger! Download today it's FREE! http
Re: [Neo] Requirements for an event framework for Neo4j
Well, these were the kind of questions I would like to get input on, what is it that you need. But since I am a user as well as a designer of this I guess I could go ahead and answer these questions from my perspective. I'll do so inline. On Wed, Mar 31, 2010 at 5:26 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Hi, Tobias. That's awesome news. A few general questions regarding an event framework for Neo4J... - In the current implementation, there's a thread affinity for transactions. I am guessing that this could create big challenges for proactive handlers that are potentially executed on a different thread? My thinking around this is that the event handlers would get access to some sort of objects that represent the changes made in the transaction. These objects would be possible to access outside of a transactional context. The Proactive handlers would however have to be executed synchronously in the same thread. The reactive handlers would execute on a different thread, and for them it would be nice to be able to operate on the graph without needing a transactional context, but I guess opening a read transaction isn't that big of a deal here anyway, so I think it will work out. - Will the handlers be synchronous or asynchronous? I answered this above... - Also, another consideration is whether or not you want to provide support for event folding for chatty changes to properties on nodes/relationships (e.g. you choose the quality of service - all changes or most recent changes only if you haven't yet processed the mutation event). I would like to keep the number of events fired to as low as possible, meaning that a onNodePropertyChage() event is probably too chatty, onBeforeWriteTransactionCommit(SomeObjectWithTheChanges) is probably a better level. But any input on what you would need is useful. So I would say that you would only observe the changes that were present at commit, and no events would be fired before commit. - What do you envision passing along with events? A full copy of the node/relationship? Only the mutated property? If we can keep it to only be the mutated state that would be great. If we can limit ourselves to the node with this ID changed somehow that would be even better. Actually I think we could limit ourselves to that since the proactive events could be fired (in the same thread as the transaction is executing in) while the transaction is still open, meaning that the modified nodes and relationships are still available, and in the reactive handlers you could open a transaction to get to the current state (the changed state might already be stale anyway). - Would there be support for bucketed notifications that would allow notifications on multiple property changes on a node to be processed as a single entity? See my answer to the folding question. Looking forward to seeing how this all materializes! Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Wednesday, March 31, 2010 6:39 AM To: Neo user discussions Subject: [Neo] Requirements for an event framework for Neo4j Fellow developers! The time has come to start the work on an event framework for Neo4j. In order to do a good work at this we would get input on what requirements you have on an event framework. We would like to get a list of use cases for which you would use an event framework, along with the features you think the use case would need from the event framework (i.e. which events you would like to receive notification about, and when). We would also like you to motivate why these features are required by the use case. Events can easily degrade performance if the framework is ill designed, so we would like to keep things very lean. We have made some early analysis and arrived at the following conclusions: * There can be two kinds of event handlers: Proactive event handlers and Reactive event handlers. Proactive event handlers have the ability to preempt operations and Reactive event handlers simply react to an event and cannot cause the event to not succeed. * There are three kinds of events in Neo4j kernel: - Lifecycle events, such as shutdown. - Transactional events, such as start commit, commit successful, rollback, etc. - Data modification events, such as node created, property changed, relationship removed, etc. It might be possible that other components, such as the indexing component, would want to add more events to the event framework. These are of course just some initial input to get your thoughts going, feel free to think outside of the constraints above. Our ultimate goal is to create an event framework that is as useful as possible while maintaining -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857
Re: [Neo] Requirements for an event framework for Neo4j
This is a somewhat related feature I'm been thinking about: A common use case is to integrate neo4j with other databases, like lucene. One way to do this by using two phase commit, which has its advantages and disadvantages. Another solution would be to use an eventually consistent strategy, meaning that the other database (lucene) polls neo4j and update the index instead of the other way around. It would be great to expose an API for reading what events has been generated and in what order - a playback of all transactions that has been committed. By using this API one can also implement a REST/Atom protocol which would allow replication of the node space to other machines. Cheers Andreas On Wed, Mar 31, 2010 at 1:54 PM, Niels Hoogeveen pd_aficion...@hotmail.com wrote: A use case I have mentioned earlier on this list is a MetaModel validator. Such a component should be triggered on transaction success to validate the added/deleted relationships, nodes and properties, and the updated property values. It's an open question to me, whether every change event should be logged by the validator, or if the validator can somehow get a set of nodes/relationship/properties from Transaction with those entities that have been touched within that transaction. The nicest solution from my point of view would be that the onSuccess event has a property touchedNodes, which is a list of node facades, where only the immutable methods of Node are implemented, and where the return value of each method returns an immutable value. The book keeping with respect to transactions is already done within the transactions, so logging all changes once more for a validator seems a waste of cycles and memory. So, to me an event with a reference to this change log, would seem the nicest solution. Kind regards, Niels Hoogeveen From: tobias.ivars...@neotechnology.com Date: Wed, 31 Mar 2010 12:39:25 +0200 To: user@lists.neo4j.org Subject: [Neo] Requirements for an event framework for Neo4j Fellow developers! The time has come to start the work on an event framework for Neo4j. In order to do a good work at this we would get input on what requirements you have on an event framework. We would like to get a list of use cases for which you would use an event framework, along with the features you think the use case would need from the event framework (i.e. which events you would like to receive notification about, and when). We would also like you to motivate why these features are required by the use case. Events can easily degrade performance if the framework is ill designed, so we would like to keep things very lean. We have made some early analysis and arrived at the following conclusions: * There can be two kinds of event handlers: Proactive event handlers and Reactive event handlers. Proactive event handlers have the ability to preempt operations and Reactive event handlers simply react to an event and cannot cause the event to not succeed. * There are three kinds of events in Neo4j kernel: - Lifecycle events, such as shutdown. - Transactional events, such as start commit, commit successful, rollback, etc. - Data modification events, such as node created, property changed, relationship removed, etc. It might be possible that other components, such as the indexing component, would want to add more events to the event framework. These are of course just some initial input to get your thoughts going, feel free to think outside of the constraints above. Our ultimate goal is to create an event framework that is as useful as possible while maintaining -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Hi Peter, As shown below, exporting the implementation package is enough to make the IndexProvider registered as OSGi service (see first line of dump). Now an exception comes later when registering the index. I guess this come from the fact that you register a service of class IndexProvider whereas db.index().forNodes() returns an instance of Index. [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel: attempting to load extensions of type org.neo4j.graphdb.index.IndexProvider Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent REGISTERED [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent UNREGISTERING [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - BundleEvent STOPPED [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - FrameworkEvent ERROR org.osgi.framework.BundleException: Exception in org.neo4j.examples.osgi.Neo4jActivator.start() of bundle BuildByTinyBundlestinybundles904955895969775UID. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337) Caused by: java.lang.IllegalArgumentException: The service object is not an instance of the service class org.neo4j.graphdb.index.IndexProvider at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:201) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525) at org.neo4j.examples.osgi.Neo4jActivator.start(Neo4jActivator.java:43) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) ... 11 more Just by modifying the test case to register an Index the test now succed : serviceRegistration = context.registerService( Index.class.getName(), db.index().forNodes( nodes ), new Properties() ); (see result below. So, after all, that make a lot of modifications for OSGi support ... I guess the easiest solution would be to create a super-bundle which would encapsulates all the actual bundles in only one. This would fix export/import package problem, and there could be a specific activator for this bundle to register services and OSGi stuff. Let me know if this solution would be acceptable, so may be I could work on this. --- T E S T S --- Running org.neo4j.examples.osgi.OSGiTest 263 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 2.1.0) created. 13 juin 2011 11:04:37 org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as /Users/nico/.m2/repository/org/ops4j/pax/exam/pax-exam-container-rbc/2.1.0/pax-exam-container-rbc-2.1.0.jar 13 juin 2011 11:04:37 org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as /Users/nico/.m2/repository/org/ops4j/pax/exam/pax-exam-extender
Re: [Neo] Requirements for an event framework for Neo4j
I don't remember the exact english name but... are you, in fact, planning some kind of stored function (like PLSQL in postgresql) ? (exemple of stored function : BEFORE INSERT ON something FOR EACH ROW EXECUTE someFunction() ) -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
No, we are not planning to build a component for stored procedures. The event framework could be used to build such a system though. That is: we are not building a system for stored procedures, but we are planning a framework that could be used to build it. Cheers, Tobias On Wed, Mar 31, 2010 at 1:52 PM, Laurent Laborde kerdez...@gmail.comwrote: I don't remember the exact english name but... are you, in fact, planning some kind of stored function (like PLSQL in postgresql) ? (exemple of stored function : BEFORE INSERT ON something FOR EACH ROW EXECUTE someFunction() ) -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Need Node.isDeleted() again ...
Hi I'm still struggling with not having a Node.isDeleted() method in the API. Here is an example where I need this method: I'm using the event framework to implemented a simple rule system. When a node/relationship changes it can trigger an action like setting a property on another node. That node must not have been deleted (in the same transaction). The only way to detect if a node has been deleted is to loop through the org.neo4j.graphdb.event.TransactionData#deletedNodes() which feel clumsy. Another solution might be to change the Event API to make this easier (and faster ?) to do ? I mostly need the isDeleted() method in my unit tests where I want to delete every node after a test, or test if a node exist or not. /Andreas ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Requirements for an event framework for Neo4j
Laurent Laborde schrieb am 31.03.2010 um 13:52:52 (+0200): I don't remember the exact english name but... are you, in fact, planning some kind of stored function (like PLSQL in postgresql) ? (exemple of stored function : BEFORE INSERT ON something FOR EACH ROW EXECUTE someFunction() ) I think what you're referring to here is *triggers* (as common in SQL databases), which react on events, not dissimilar to what has been outlined by Tobias in the mail you're replying to. -- Michael Ludwig ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [Neo] Event framework has landed
On Fri, Jun 11, 2010 at 12:54 PM, Mattias Persson matt...@neotechnology.com wrote: BabuDb has a db.prefixLookup( key|value| ) method so that's the one I'm using. I wonder how well that scales. I'd like to see some performance figures from indexing massive volumes and then doing lookup based on prefixLookup. -- 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
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Hi Peter, I've tried to run your test case on my forked version. First of all, I got a Framework exception when running the test case out of the box : [Framework Event Dispatcher] DEBUG wrap_mvn_org.apache.lucene_lucene-core_3.1.0 - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - FrameworkEvent ERROR org.osgi.framework.BundleException: The bundle org.neo4j.lucene-index_1.4.0.SNAPSHOT [9] could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.lucene.analysis; version=3.0.0 This shows the lucene-index bundle has a unresolved imported package. That strange because lucene-core is deployed wrapped into a bundle just before. There may be a problem with the wrapping process... So, i changed the test case to use org.apache.servicemix.bundles.lucene:3.0.3_1, which is a bundled version of lucene 3.0.3 that i've been using during my forking tests. Using this bundle version and my forked bundles, I get the execution trace shown below. The test case still fails, but somewhere else. Let me explain: To manage services loaded using JDK service feature from other bundles, my forked version automatically registers declared JDK services as OSGi services. This is done is the OSGiExtensionLoader.registerBundleServices method (https://github.com/njouanin/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/osgi/OSGiExtensionLoader.java). So, using my forked version, the LuceneIndexProvider is being exposed as OSGi service, so it is visible to OSGi loader and org.neo4j.kernel.IndexManagerImpl.getIndexProvider shouldn't throw IllegalArgumentException anymore. BUT, as shown below, i know have a exception during datasource initialisation. The LuceneDataSource class is not visible to the kernel bundle, where service registration occurs. So I see two possible solution for this : - change lucene-index bundle to export-package org.neo4j.index.impl.lucene (bad solution) - add a bundle activator in lucene-index bundle to register LuceneIndexProvider service on bundle startup, but I don't know its dependencies. Let me know if my analysis is not clear for you ... PS : changes made to the test case have been comited to git://github.com/njouanin/neo4j-osgi-examples.git [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED activating null null [Framework Event Dispatcher] DEBUG com.springsource.javax.transaction - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.kernel: Service org.neo4j.kernel.impl.transaction.TransactionManagerProvider registered with implementation org.neo4j.kernel.impl.transaction.TransactionManagerProvider[native] [Framework Event Dispatcher] WARN org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Implementation class org.neo4j.kernel.impl.management.JmxExtension not found by classloader Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Framework Event Dispatcher] DEBUG org.neo4j.kernel - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.kernel: Service org.neo4j.kernel.Version registered with implementation Neo4j - Graph Database Kernel 1.4-SNAPSHOT (revision: 1.4.M01-32-g51e2494-dirty) [Framework Event Dispatcher] DEBUG org.apache.servicemix.bundles.lucene - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel: attempting to load extensions of type org.neo4j.graphdb.index.IndexProvider org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene-index[lucene-index] at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModule.java:181) at org.neo4j.index.impl.lucene.LuceneIndexImplementation.init(LuceneIndexImplementation.java:72) at org.neo4j.index.impl.lucene.LuceneIndexProvider.load(LuceneIndexProvider.java:38) at org.neo4j.kernel.KernelData.loadIndexImplementations(KernelData.java:146) at org.neo4j.kernel.EmbeddedGraphDbImpl$2.initializeIndexProviders(EmbeddedGraphDbImpl.java:179) at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:159) at org.neo4j.kernel.EmbeddedGraphDbImpl.init(EmbeddedGraphDbImpl.java:189) at org.neo4j.kernel.EmbeddedGraphDatabase.init(EmbeddedGraphDatabase.java:79
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Nicolas, thanks for looking into this! If you only move the LuceneDataSource into an exported package, for instance org.neo4j.index.lucene, and export it, would that be sufficient to get the registration done? I don't want to force OSGi upon all Index provider bundles (yet) and keep the impact of making this work at a minimum. 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 Sat, Jun 11, 2011 at 10:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've tried to run your test case on my forked version. First of all, I got a Framework exception when running the test case out of the box : [Framework Event Dispatcher] DEBUG wrap_mvn_org.apache.lucene_lucene-core_3.1.0 - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - FrameworkEvent ERROR org.osgi.framework.BundleException: The bundle org.neo4j.lucene-index_1.4.0.SNAPSHOT [9] could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.lucene.analysis; version=3.0.0 This shows the lucene-index bundle has a unresolved imported package. That strange because lucene-core is deployed wrapped into a bundle just before. There may be a problem with the wrapping process... So, i changed the test case to use org.apache.servicemix.bundles.lucene:3.0.3_1, which is a bundled version of lucene 3.0.3 that i've been using during my forking tests. Using this bundle version and my forked bundles, I get the execution trace shown below. The test case still fails, but somewhere else. Let me explain: To manage services loaded using JDK service feature from other bundles, my forked version automatically registers declared JDK services as OSGi services. This is done is the OSGiExtensionLoader.registerBundleServices method (https://github.com/njouanin/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/osgi/OSGiExtensionLoader.java). So, using my forked version, the LuceneIndexProvider is being exposed as OSGi service, so it is visible to OSGi loader and org.neo4j.kernel.IndexManagerImpl.getIndexProvider shouldn't throw IllegalArgumentException anymore. BUT, as shown below, i know have a exception during datasource initialisation. The LuceneDataSource class is not visible to the kernel bundle, where service registration occurs. So I see two possible solution for this : - change lucene-index bundle to export-package org.neo4j.index.impl.lucene (bad solution) - add a bundle activator in lucene-index bundle to register LuceneIndexProvider service on bundle startup, but I don't know its dependencies. Let me know if my analysis is not clear for you ... PS : changes made to the test case have been comited to git://github.com/njouanin/neo4j-osgi-examples.git [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED activating null null [Framework Event Dispatcher] DEBUG com.springsource.javax.transaction - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.kernel: Service org.neo4j.kernel.impl.transaction.TransactionManagerProvider registered with implementation org.neo4j.kernel.impl.transaction.TransactionManagerProvider[native] [Framework Event Dispatcher] WARN org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Implementation class org.neo4j.kernel.impl.management.JmxExtension not found by classloader Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Framework Event Dispatcher] DEBUG org.neo4j.kernel - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.kernel: Service org.neo4j.kernel.Version registered with implementation Neo4j - Graph Database Kernel 1.4-SNAPSHOT (revision: 1.4.M01-32-g51e2494-dirty) [Framework Event Dispatcher] DEBUG org.apache.servicemix.bundles.lucene - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.lucene-index - ServiceEvent REGISTERED [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel
Re: [Neo] LuceneIndexService dependencies on EmbeddedGraphDatabase
As you say, a meta model validator is something that would sit nicely on top of the event framework. And the plans for such a component is to not work on it before the event framework is in place. Regarding the timeline for the event framework it looks like we could have a first version in the repository at the earliest in the early summer months (June or so). I've planned to send out an e-mail to the list with our initial design plans for it, and ask for input on some key features Pretty Soon™. Cheers, Tobias On Mon, Mar 15, 2010 at 3:12 PM, Niels Hoogeveen pd_aficion...@hotmail.comwrote: Thanks for your response Mattias. I hope you don't mind my critical notes so far. For the last week, I have been working with Neo4J and really appreciate this product, while knowing it is at a 1.0 stage. The underlying machinery seems pretty mature for a 1.0 version, but some parts show it has not been exposed to thousands of different implementations yet. So I hope my finding some corner cases helps iron out some of those issues for upcoming releases. With respect to the meta layer, I would be interested in seeing a validator. So far I have not found such a component in the Neo4J code stack. Do you have plans to create one? I am willing to contribute code, even if it means using Java instead of Scala for a change. It seems a meta schema validator can only work once the event frame work is hooked up to the rest of the machinery. I have looked at the org.neo4j.kernel.impl.event package, but this seems to be referenced only once, registering the event manager within the kernel config. Do you have a timeline for the event framework? I know it is intended for version 1.1, but working on a validator doesn't necessarily have to wait until the final release of 1.1. Kind regards, Niels Hoogeveen Date: Mon, 15 Mar 2010 11:30:04 +0100 From: matt...@neotechnology.com To: user@lists.neo4j.org Subject: Re: [Neo] LuceneIndexService dependencies on EmbeddedGraphDatabase Yep, LuceneIndexService needs to register itself as an XA resource and needs the XA datasource manager from the EmbeddedGraphDatabase class. This isn't exposed in the GraphDatabaseService interface as of yet, but things like this are in the pipeline to be fixed. 2010/3/14 Niels Hoogeveen pd_aficion...@hotmail.com: I tried to wrap the EmbeddedGraphDatabase in a different class implementing the GraphDatabaseService interface. When using LuceneIndexService I get a class cast exception, because internally LuceneIndexService casts any instance of GraphDatabaseService to EmbeddedGraphDatabase. I would expect when the LuceneIndexService constructor requires a GraphDatabaseService that any class implementing that interface would work, otherwise the constructor should require an EmbeddedGraphDatabase instance. Kind regards, Niels Hoogeveen _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
I'll work on this then and i'll let you know in the coming days. 2011/6/14 Peter Neubauer peter.neuba...@neotechnology.com Nicolas, yes, after looking into the details involved, I think an official superbundle with the core Neo4j components bundled and exported woudl be the best way forward. Also, it would expose less granular bundles into an OSGi environment. Other IndexProviders etc could be then inserted as fragments into that bundle. It would be absolutely fantastic if you could work on that, maybe using the neo4j-osgi-examples as the demo project? We could then have a packaging project there or in a neo4j-osgi component that does the actual production of the superbundle. WDYT? 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 Mon, Jun 13, 2011 at 11:10 AM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, As shown below, exporting the implementation package is enough to make the IndexProvider registered as OSGi service (see first line of dump). Now an exception comes later when registering the index. I guess this come from the fact that you register a service of class IndexProvider whereas db.index().forNodes() returns an instance of Index. [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel: attempting to load extensions of type org.neo4j.graphdb.index.IndexProvider Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent REGISTERED [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent UNREGISTERING [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - BundleEvent STOPPED [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - FrameworkEvent ERROR org.osgi.framework.BundleException: Exception in org.neo4j.examples.osgi.Neo4jActivator.start() of bundle BuildByTinyBundlestinybundles904955895969775UID. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337) Caused by: java.lang.IllegalArgumentException: The service object is not an instance of the service class org.neo4j.graphdb.index.IndexProvider at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:201) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525) at org.neo4j.examples.osgi.Neo4jActivator.start(Neo4jActivator.java:43) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) ... 11 more Just by modifying the test case to register an Index the test now succed : serviceRegistration
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Hi Peter (and others), May be you can help me with github... I'dl like to work on this superbundle using the last version of neo4j-community. The problem is that i've already forked this repo for my previous work and now I can't fork it anymore. Also, i've made my modifications on the master branch. Do you know a way of getting the last version of the source code without loosing my previous work ? I was thinking of checking out back to the time I've forked, then create a branch, then pull changes from the original repo. Thx. Le 14 juin 2011 à 09:03, Peter Neubauer a écrit : Nicolas, yes, after looking into the details involved, I think an official superbundle with the core Neo4j components bundled and exported woudl be the best way forward. Also, it would expose less granular bundles into an OSGi environment. Other IndexProviders etc could be then inserted as fragments into that bundle. It would be absolutely fantastic if you could work on that, maybe using the neo4j-osgi-examples as the demo project? We could then have a packaging project there or in a neo4j-osgi component that does the actual production of the superbundle. WDYT? 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 Mon, Jun 13, 2011 at 11:10 AM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, As shown below, exporting the implementation package is enough to make the IndexProvider registered as OSGi service (see first line of dump). Now an exception comes later when registering the index. I guess this come from the fact that you register a service of class IndexProvider whereas db.index().forNodes() returns an instance of Index. [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel: attempting to load extensions of type org.neo4j.graphdb.index.IndexProvider Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent REGISTERED [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent UNREGISTERING [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - BundleEvent STOPPED [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - FrameworkEvent ERROR org.osgi.framework.BundleException: Exception in org.neo4j.examples.osgi.Neo4jActivator.start() of bundle BuildByTinyBundlestinybundles904955895969775UID. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337) Caused by: java.lang.IllegalArgumentException: The service object is not an instance of the service class org.neo4j.graphdb.index.IndexProvider at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:201) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:507) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:525
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Yes, that's what I managed to do : remaned master to a new branch then checkout upstream/master in local master. Thanks. 2011/6/15 Peter Neubauer peter.neuba...@neotechnology.com Nicolas, I think you could just make another branch, or rename the master branch to something else. Then, you could set up a new master and let it track the original master? 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 Tue, Jun 14, 2011 at 10:12 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter (and others), May be you can help me with github... I'dl like to work on this superbundle using the last version of neo4j-community. The problem is that i've already forked this repo for my previous work and now I can't fork it anymore. Also, i've made my modifications on the master branch. Do you know a way of getting the last version of the source code without loosing my previous work ? I was thinking of checking out back to the time I've forked, then create a branch, then pull changes from the original repo. Thx. Le 14 juin 2011 à 09:03, Peter Neubauer a écrit : Nicolas, yes, after looking into the details involved, I think an official superbundle with the core Neo4j components bundled and exported woudl be the best way forward. Also, it would expose less granular bundles into an OSGi environment. Other IndexProviders etc could be then inserted as fragments into that bundle. It would be absolutely fantastic if you could work on that, maybe using the neo4j-osgi-examples as the demo project? We could then have a packaging project there or in a neo4j-osgi component that does the actual production of the superbundle. WDYT? 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 Mon, Jun 13, 2011 at 11:10 AM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, As shown below, exporting the implementation package is enough to make the IndexProvider registered as OSGi service (see first line of dump). Now an exception comes later when registering the index. I guess this come from the fact that you register a service of class IndexProvider whereas db.index().forNodes() returns an instance of Index. [Framework Event Dispatcher] INFO org.neo4j.kernel.impl.osgi.OSGiExtensionLoader - Bundle org.neo4j.lucene-index: Service org.neo4j.graphdb.index.IndexProvider registered with implementation org.neo4j.graphdb.index.IndexProvider[lucene] Kernel: attempting to load extensions of type org.neo4j.kernel.KernelExtension Kernel: attempting to load extensions of type org.neo4j.graphdb.index.IndexProvider Kernel: attempting to load extensions of type org.neo4j.kernel.Version [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent REGISTERED [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - ServiceEvent UNREGISTERING [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - BundleEvent STOPPED [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles904955895969775UID - FrameworkEvent ERROR org.osgi.framework.BundleException: Exception in org.neo4j.examples.osgi.Neo4jActivator.start() of bundle BuildByTinyBundlestinybundles904955895969775UID. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459
[Neo] Event framework has landed
Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
Could you please supply code to reproduce this? 2010/4/29 Atle Prange atle.pra...@gmail.com Really nice, but it seems that afterCommit() never receives any data, the TransactionData argument is always null.. On Tue, Apr 27, 2010 at 10:15 AM, Mattias Persson matt...@neotechnology.com wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
Oo, wait a minute... I saw the problem. Try again with the latest code (just committed)! 2010/4/29 Atle Prange atle.pra...@gmail.com Really nice, but it seems that afterCommit() never receives any data, the TransactionData argument is always null.. On Tue, Apr 27, 2010 at 10:15 AM, Mattias Persson matt...@neotechnology.com wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
On Thu, Apr 29, 2010 at 2:19 PM, Atle Prange atle.pra...@gmail.com wrote: BTW.: I wrote a new IndexService using BabuDB [1]. BabuDB is really fast, but does not work for fulltext query. For now the IndexService is embedded in the Object-graph mapper i wrote [2]. Anyone is free to check it out, if it looks interesting it could be moved to a neo4j subproject. Nice. Does BaduDB expose an XAResource? that would make it a whole lot easier to integrate with the transaction system of Neo4j. -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [Neo] Event framework has landed
Yes, babudb would for example be very fast for a primary key index. How do you think a trie implemented in neo4j would compare to the others? One could have relationship types for each letter. Then a search for the word faster, would involve six Node.getRelationShip(RelationshipType,Direction) calls and six Relationship.getEndNode() calls. Insertion would at worst case create six nodes and six relationships. It would also be interesting to test the performance given a more realistic usage pattern. For example many random reads and writes. One reason for lucene to beat babudb might be its caching or batching capabilities. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Need Node.isDeleted() again ...
2010/12/14 Andreas Ronge andreas.ro...@gmail.com Hi I'm still struggling with not having a Node.isDeleted() method in the API. Here is an example where I need this method: I'm using the event framework to implemented a simple rule system. When a node/relationship changes it can trigger an action like setting a property on another node. That node must not have been deleted (in the same transaction). The only way to detect if a node has been deleted is to loop through the org.neo4j.graphdb.event.TransactionData#deletedNodes() which feel clumsy. Another solution might be to change the Event API to make this easier (and faster ?) to do ? Yes, maybe the data in TransactionData could be a little better, f.ex. exposing a method #nodeIsDeleted(Node) and many more of those? I mostly need the isDeleted() method in my unit tests where I want to delete every node after a test, or test if a node exist or not. /Andreas ___ 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] question about remove and iterate in same transaction
Hi Jose, Perhaps the event framework[1] would suit your purpose. The TransactionEventHandler [2] includes operations for intercepting a transaction before it is committed. Otherwise, to intercept the Node.delete call itself, you'd have to look into using AOP. Cheers, Andreas [1] http://wiki.neo4j.org/content/Event_framework [2] http://components.neo4j.org/neo4j/1.4.M02/apidocs/org/neo4j/graphdb/event/TransactionEventHandler.html On May 24, 2011, at 6:59 AM, Jose Angel Inda Herrera wrote: how could include a function in the Node class I check if a node is being removed or not. for example, have an attribute in the class that implements a node when it is created, and when it is called the delete function to change the value attribute and thus can control whether to delete or not. I need help on this ___ 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] question about remove and iterate in same transaction
El 5/24/2011 9:12 AM, Andreas Kollegger escribió: Hi Jose, Perhaps the event framework[1] would suit your purpose. The TransactionEventHandler [2] includes operations for intercepting a transaction before it is committed. Otherwise, to intercept the Node.delete call itself, you'd have to look into using AOP. Cheers, Andreas [1] http://wiki.neo4j.org/content/Event_framework [2] http://components.neo4j.org/neo4j/1.4.M02/apidocs/org/neo4j/graphdb/event/TransactionEventHandler.html On May 24, 2011, at 6:59 AM, Jose Angel Inda Herrera wrote: how could include a function in the Node class I check if a node is being removed or not. for example, have an attribute in the class that implements a node when it is created, and when it is called the delete function to change the value attribute and thus can control whether to delete or not. I need help on this ___ 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 thanks andreas, but you can explain to me that is AOP and how using thanks and cheers ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Transaction Event Listeners
Hi Raul! Yes, Neo4j has such functionality, but we have not specified the final API for it yet. There is code implementing it from an old API that we used in house back when Neo4j was young. I don't know if all functionality of it is still hooked up though, and it is of course undocumented. If you look in the org.neo4j.kernel.impl.event package of the Neo4j kernel component there is the current code for it. It is highly volatile and likely only work with the current (1.0-rc) and next (1.0) release, since a public event framework is planned for the release after that (1.1). Since the proper event API isn't done yet, it is still possible to come with suggestions to how you would want it to work. Do you want events to be fired just before commit or just after? Or perhaps hooks for both? What data would you want access to in the event callback? Do you want a coarse grained events (commit, rollback) or fine grained events (node_created, node_property_set, relationship_created, ...)? Ideas are welcome! Cheers, Tobias On Thu, Jan 14, 2010 at 1:32 AM, Raul Raja Martinez raulr...@gmail.comwrote: Hi, Does neo4j provide some way for adding listeners to the transaction lifecycle? We would like to intercept when transacions are commited, created and rolledback to provide our own functionality for example ensure that a given node property is always set or some other properties are within a range. Most ORM solutions like hibernate allow devs to register to events in the system to which they can react when certain events are triggered. We need such functionality in general for Traversers, Transactions, Inserts, Updates, Cache etc... ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
Fixed, nice :) atle On Thu, Apr 29, 2010 at 12:16 PM, Mattias Persson matt...@neotechnology.com wrote: Oo, wait a minute... I saw the problem. Try again with the latest code (just committed)! 2010/4/29 Atle Prange atle.pra...@gmail.com Really nice, but it seems that afterCommit() never receives any data, the TransactionData argument is always null.. On Tue, Apr 27, 2010 at 10:15 AM, Mattias Persson matt...@neotechnology.com wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
Hi Mattias, hi list that's just what I've been looking for, congratulations on the amazing progress you are making on Neo4j! I am actually trying to use the TransactionEventHandler to implement automatic versioning similar to what was discussed a while ago. The beforeCommit() handler seems like a perfect fit and provides all the data I need. Still, I have one problem: in beforeCommit() I fetch and increment a revision number that's stored in a special node and use that number to build the current revision structure. This brings up a few questions: 1. How atomic are Neo4j commits? Will two concurrent commits interfere when getting and incrementing the revision number? 2. How can I return the revision number from the TransactionEventHandler so I can use it in the caller (my service classes in this case)? 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Calling org.neo4j.graphdb.index.Index#remove in a beforeCommit event, allowed ?
Sorry, found the bug in my code. It's rather difficult to debug when using the neo4j event framework since the stack trace doesn't give you much clues of what went wrong. It may be something that has occurred earlier that causes the problem, like calling methods on a deleted node. Cheers Andreas On Mon, Sep 20, 2010 at 4:12 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Andreas, that is strange. In the beforeCommit, there should be a Transaction open already. Also, are you deleting the Node in the same thread or a new one? Mattias, any comment on that? Cheers, /peter neubauer COO and Sales, Neo Technology 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Fri, Sep 17, 2010 at 6:05 AM, Andreas Ronge andreas.ro...@jayway.se wrote: Hi Is it not possible to call org.neo4j.graphdb.index.Index#remove when it's triggered from a beforeCommit event ? I get the following exception: (The TxData object contains the removed property (removedNodeProperties) that I want lucene to remove from it's index with the remove method.) class org.neo4j.graphdb.NotInTransactionException'; Message: null; StackTrace: org.neo4j.graphdb.NotInTransactionException at org.neo4j.index.impl.lucene.ConnectionBroker.acquireResourceConnection(ConnectionBroker.java:32) at org.neo4j.index.impl.lucene.LuceneIndex.getConnection(LuceneIndex.java:55) at org.neo4j.index.impl.lucene.LuceneIndex.remove(LuceneIndex.java:108) at org.neo4j.kernel.impl.core.TransactionEventsSyncHook.beforeCompletion(TransactionEventsSyncHook.java:76) at org.neo4j.kernel.impl.transaction.TransactionImpl.doBeforeCompletion(TransactionImpl.java:342) at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:569) at org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:104) at org.neo4j.kernel.EmbeddedGraphDbImpl$TransactionImpl.finish(EmbeddedGraphDbImpl.java:513) 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.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:508) I have probably done something stupid. Cheers ___ 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: [Neo] Transaction Event Listeners
Hi Tobias, thanks for the info! I'm gonna consult with my team and we'll get back with some suggestions. 2010/1/14 Tobias Ivarsson tobias.ivars...@neotechnology.com: Hi Raul! Yes, Neo4j has such functionality, but we have not specified the final API for it yet. There is code implementing it from an old API that we used in house back when Neo4j was young. I don't know if all functionality of it is still hooked up though, and it is of course undocumented. If you look in the org.neo4j.kernel.impl.event package of the Neo4j kernel component there is the current code for it. It is highly volatile and likely only work with the current (1.0-rc) and next (1.0) release, since a public event framework is planned for the release after that (1.1). Since the proper event API isn't done yet, it is still possible to come with suggestions to how you would want it to work. Do you want events to be fired just before commit or just after? Or perhaps hooks for both? What data would you want access to in the event callback? Do you want a coarse grained events (commit, rollback) or fine grained events (node_created, node_property_set, relationship_created, ...)? Ideas are welcome! Cheers, Tobias On Thu, Jan 14, 2010 at 1:32 AM, Raul Raja Martinez raulr...@gmail.comwrote: Hi, Does neo4j provide some way for adding listeners to the transaction lifecycle? We would like to intercept when transacions are commited, created and rolledback to provide our own functionality for example ensure that a given node property is always set or some other properties are within a range. Most ORM solutions like hibernate allow devs to register to events in the system to which they can react when certain events are triggered. We need such functionality in general for Traversers, Transactions, Inserts, Updates, Cache etc... ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Raul Raja ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
No, its just an index/key-value store with no transactional capabilities other than when no exception is being thrown, the index is updated. Any tx handling must be impemented on top. On Thu, Apr 29, 2010 at 2:35 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: On Thu, Apr 29, 2010 at 2:19 PM, Atle Prange atle.pra...@gmail.com wrote: BTW.: I wrote a new IndexService using BabuDB [1]. BabuDB is really fast, but does not work for fulltext query. For now the IndexService is embedded in the Object-graph mapper i wrote [2]. Anyone is free to check it out, if it looks interesting it could be moved to a neo4j subproject. Nice. Does BaduDB expose an XAResource? that would make it a whole lot easier to integrate with the transaction system of Neo4j. -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [Neo] Event framework has landed
2010/6/16 Atle Prange atle.pra...@gmail.com: Yes, babudb would for example be very fast for a primary key index. How do you think a trie implemented in neo4j would compare to the others? One could have relationship types for each letter. Then a search for the word faster, would involve six Node.getRelationShip(RelationshipType,Direction) calls and six Relationship.getEndNode() calls. Insertion would at worst case create six nodes and six relationships. It would also be interesting to test the performance given a more realistic usage pattern. For example many random reads and writes. One reason for lucene to beat babudb might be its caching or batching capabilities. Yeah that'd be interesting... and probably quite easy to try out. Are you feeling up to it? :) ___ 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] [Neo] Event framework has landed
yes :) atle On Thu, Jun 17, 2010 at 1:37 PM, Mattias Persson matt...@neotechnology.com wrote: 2010/6/16 Atle Prange atle.pra...@gmail.com: Yes, babudb would for example be very fast for a primary key index. How do you think a trie implemented in neo4j would compare to the others? One could have relationship types for each letter. Then a search for the word faster, would involve six Node.getRelationShip(RelationshipType,Direction) calls and six Relationship.getEndNode() calls. Insertion would at worst case create six nodes and six relationships. It would also be interesting to test the performance given a more realistic usage pattern. For example many random reads and writes. One reason for lucene to beat babudb might be its caching or batching capabilities. Yeah that'd be interesting... and probably quite easy to try out. Are you feeling up to it? :) ___ 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] Does removing a node/relationship automatically remove it from all indices?
Hey, I'm also looking forward to a time where there's a good auto-indexer (and maybe integrated with a meta model to describe what to index), using the event framework. Blueprints requires two indices be created on the construction of a new graph. AutomaticIndexVertex AutomaticIndexEdge http://github.com/tinkerpop/blueprints/blob/327d0c59ec5416677c67d20947225e16734b679f/src/main/java/com/tinkerpop/blueprints/pgm/AutomaticIndex.java where all properties of the vertices and edges are deemed indexable (null wildcard on autoIndexKey). I do this for the ease of use factor. Hardcore users can always drop these indices and do manual insertion into indices or, at a later date, add them back in, but its definitely useful as, for the most part, I would like to say: autoIndex.addIndexKey(name) autoIndex.addIndexKey(location) // where null means wildcard. ...and never again in my code deal with updating indices --- only deal with index.get(location, santa fe). Another feature I'm thinking of adding is reindex (so users can have indices that are created after the initial graph was constructed). Take care, Marko. http://markorodriguez.com http://tinkerpop.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [Neo] Event framework has landed
Regarding the performance: I have tried to tweak Babudb, but could not get any more out of it than you did. I guess when you put 5M entries at once, there is only so much tweaking one can do. (At least for babudb). It seems odd though, since babudb is a less complicated framework, with less features. We should contact the babudb guys and ask why we see the results that we see. Regarding keys: Having one entry in the db for each value will give the fastest update speed, but will be slower for a large number of nodes with the same value. Having an entry with all the ids will make a large entry, causing more bytes to be written to disk for every update. On Fri, Jun 11, 2010 at 1:51 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: On Fri, Jun 11, 2010 at 12:54 PM, Mattias Persson matt...@neotechnology.com wrote: BabuDb has a db.prefixLookup( key|value| ) method so that's the one I'm using. I wonder how well that scales. I'd like to see some performance figures from indexing massive volumes and then doing lookup based on prefixLookup. -- 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 mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Need Node.isDeleted() again ...
I just added TransactionData#isDeleted(Node) and TransactionData#isDeleted(Relationship) and made the internal collection to hold the deleted entities a HashSet for fast lookups. 2010/12/15 Mattias Persson matt...@neotechnology.com 2010/12/14 Andreas Ronge andreas.ro...@gmail.com Hi I'm still struggling with not having a Node.isDeleted() method in the API. Here is an example where I need this method: I'm using the event framework to implemented a simple rule system. When a node/relationship changes it can trigger an action like setting a property on another node. That node must not have been deleted (in the same transaction). The only way to detect if a node has been deleted is to loop through the org.neo4j.graphdb.event.TransactionData#deletedNodes() which feel clumsy. Another solution might be to change the Event API to make this easier (and faster ?) to do ? Yes, maybe the data in TransactionData could be a little better, f.ex. exposing a method #nodeIsDeleted(Node) and many more of those? I mostly need the isDeleted() method in my unit tests where I want to delete every node after a test, or test if a node exist or not. /Andreas ___ 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 -- 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] Need Node.isDeleted() again ...
Thanks ! but maybe it will be slower if one only have one deleted node in a tx ? Want it fast both for small and huge transactions is it not possible to find out if a node is deleted or not without using an internal collection ? On Sunday, December 19, 2010, Mattias Persson matt...@neotechnology.com wrote: I just added TransactionData#isDeleted(Node) and TransactionData#isDeleted(Relationship) and made the internal collection to hold the deleted entities a HashSet for fast lookups. 2010/12/15 Mattias Persson matt...@neotechnology.com 2010/12/14 Andreas Ronge andreas.ro...@gmail.com Hi I'm still struggling with not having a Node.isDeleted() method in the API. Here is an example where I need this method: I'm using the event framework to implemented a simple rule system. When a node/relationship changes it can trigger an action like setting a property on another node. That node must not have been deleted (in the same transaction). The only way to detect if a node has been deleted is to loop through the org.neo4j.graphdb.event.TransactionData#deletedNodes() which feel clumsy. Another solution might be to change the Event API to make this easier (and faster ?) to do ? Yes, maybe the data in TransactionData could be a little better, f.ex. exposing a method #nodeIsDeleted(Node) and many more of those? I mostly need the isDeleted() method in my unit tests where I want to delete every node after a test, or test if a node exist or not. /Andreas ___ 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 -- 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] question about remove and iterate in same transaction
Aspect Oriented Programming[1] (AOP) lets you decorate classes and methods with extra behavior. Assuming that you're working with Neo4j in an embedded application, you'd use a library like AspectJ [2][3] to add advice to the Node.delete (actually the NodeImpl class) to perform your logic before the actual method is called, giving you the opportunity to *not* call the actual method. Personally, I always find it a bit scary to use AOP, but when it works it seems magical. Cheers, Andreas [1] http://en.wikipedia.org/wiki/Aspect-oriented_programming [2] http://en.wikipedia.org/wiki/AspectJ [3] http://www.eclipse.org/aspectj/ On May 24, 2011, at 12:41 PM, Jose Angel Inda Herrera wrote: El 5/24/2011 9:12 AM, Andreas Kollegger escribió: Hi Jose, Perhaps the event framework[1] would suit your purpose. The TransactionEventHandler [2] includes operations for intercepting a transaction before it is committed. Otherwise, to intercept the Node.delete call itself, you'd have to look into using AOP. Cheers, Andreas [1] http://wiki.neo4j.org/content/Event_framework [2] http://components.neo4j.org/neo4j/1.4.M02/apidocs/org/neo4j/graphdb/event/TransactionEventHandler.html On May 24, 2011, at 6:59 AM, Jose Angel Inda Herrera wrote: how could include a function in the Node class I check if a node is being removed or not. for example, have an attribute in the class that implements a node when it is created, and when it is called the delete function to change the value attribute and thus can control whether to delete or not. I need help on this ___ 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 thanks andreas, but you can explain to me that is AOP and how using thanks and cheers ___ 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] Does removing a node/relationship automatically remove it from all indices?
2010/10/27, Rick Bullotta rick.bullo...@burningskysoftware.com: I think so ;-). But I suppose one question is, with the new framework, will you still be able to explicitly remove/delete a node from an index? Adding a method for removing a node from an index would be good to have and may pop up soon there. I'm also looking forward to a time where there's a good auto-indexer (and maybe integrated with a meta model to describe what to index), using the event framework. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Wednesday, October 27, 2010 1:06 PM To: Neo4j user discussions Subject: Re: [Neo4j] Does removing a node/relationship automatically remove it from all indices? I assume we're talking about the new integrated index framework (not IndexService), right? The Index framework which will replace IndexService and has ability to index relationships and all that? It's not a hard thing to implement the auto self-healing, clearing of deleted entities from an index when encountered... I just haven't gotten around to it. It's quite a nice feature, since it already hides them for you, it might as well delete them for you. 2010/10/27, Marko Rodriguez okramma...@gmail.com: Hi, The implementation is currently that if you forget to remove it from the index it will be filtered out of the query result silently... but over time that list of dead entities could grow, if the index couldn't somehow self-heal, which it definately could... well a lot could be done there. Yes. This is what I noticed: I was deleting vertices/edges, and when querying the index, they were not returned. So I assumed that you had auto clearing in the Index implementation. I was excited. However, now I see its a silent delete on query. Now, I suppose in Blueprints, I can, for every deleted vertex/edge, go through the indices and remove them for every key/value property they have. However, this is time consuming and would yield slow delete speeds. Thoughts? Should I just let the silent delete happen? Will there be plans to automagically remove non-existent PropertyContainers from the indices? Thank you for your time, Marko. ___ 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 -- 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: [Neo] Transaction Event Listeners
Hi Tobias, At this time we need... - Before Transaction Commit - Dirty nodes - Properties - Relationships - After Transaction Commit - Committed Nodes - Properties - Relationships I can see how other events would be useful such as property set, removed, changed... I think I'd be great if none of these are actually evaluated, stored or processed unless there are listeners expecting to be notified. Also we need to understand the scope of getting notified by such events in the context of HA where the event may be trigger in a server in the cluster or in all of them at once if the transactions are distributed. Thanks! 2010/1/14 Raul Raja Martinez raulr...@gmail.com: Hi Tobias, thanks for the info! I'm gonna consult with my team and we'll get back with some suggestions. 2010/1/14 Tobias Ivarsson tobias.ivars...@neotechnology.com: Hi Raul! Yes, Neo4j has such functionality, but we have not specified the final API for it yet. There is code implementing it from an old API that we used in house back when Neo4j was young. I don't know if all functionality of it is still hooked up though, and it is of course undocumented. If you look in the org.neo4j.kernel.impl.event package of the Neo4j kernel component there is the current code for it. It is highly volatile and likely only work with the current (1.0-rc) and next (1.0) release, since a public event framework is planned for the release after that (1.1). Since the proper event API isn't done yet, it is still possible to come with suggestions to how you would want it to work. Do you want events to be fired just before commit or just after? Or perhaps hooks for both? What data would you want access to in the event callback? Do you want a coarse grained events (commit, rollback) or fine grained events (node_created, node_property_set, relationship_created, ...)? Ideas are welcome! Cheers, Tobias On Thu, Jan 14, 2010 at 1:32 AM, Raul Raja Martinez raulr...@gmail.com wrote: Hi, Does neo4j provide some way for adding listeners to the transaction lifecycle? We would like to intercept when transacions are commited, created and rolledback to provide our own functionality for example ensure that a given node property is always set or some other properties are within a range. Most ORM solutions like hibernate allow devs to register to events in the system to which they can react when certain events are triggered. We need such functionality in general for Traversers, Transactions, Inserts, Updates, Cache etc... ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Raul Raja -- Raul Raja ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Transaction Event Listeners
At the moment you cannot register listeners for committed nodes or stuff like that, but you could take a look at the TransactionEventManager in the utils component, http://components.neo4j.org/neo4j-utils/ . You can use it to register listeners for events that you send yourself. Your listeners will then get those events as an array after a successful commit. That's not really what you asked for though. Another thing would be to register synchronization hooks on the JTA transactions, however that way you'll only be notified before and after a transaction is committed, not _what_ was committed. If any of those suggestions would be useful I'd be happy to give an example of such code. 2010/1/14 Raul Raja Martinez raulr...@gmail.com: Hi Tobias, At this time we need... - Before Transaction Commit - Dirty nodes - Properties - Relationships - After Transaction Commit - Committed Nodes - Properties - Relationships I can see how other events would be useful such as property set, removed, changed... I think I'd be great if none of these are actually evaluated, stored or processed unless there are listeners expecting to be notified. Also we need to understand the scope of getting notified by such events in the context of HA where the event may be trigger in a server in the cluster or in all of them at once if the transactions are distributed. Thanks! 2010/1/14 Raul Raja Martinez raulr...@gmail.com: Hi Tobias, thanks for the info! I'm gonna consult with my team and we'll get back with some suggestions. 2010/1/14 Tobias Ivarsson tobias.ivars...@neotechnology.com: Hi Raul! Yes, Neo4j has such functionality, but we have not specified the final API for it yet. There is code implementing it from an old API that we used in house back when Neo4j was young. I don't know if all functionality of it is still hooked up though, and it is of course undocumented. If you look in the org.neo4j.kernel.impl.event package of the Neo4j kernel component there is the current code for it. It is highly volatile and likely only work with the current (1.0-rc) and next (1.0) release, since a public event framework is planned for the release after that (1.1). Since the proper event API isn't done yet, it is still possible to come with suggestions to how you would want it to work. Do you want events to be fired just before commit or just after? Or perhaps hooks for both? What data would you want access to in the event callback? Do you want a coarse grained events (commit, rollback) or fine grained events (node_created, node_property_set, relationship_created, ...)? Ideas are welcome! Cheers, Tobias On Thu, Jan 14, 2010 at 1:32 AM, Raul Raja Martinez raulr...@gmail.com wrote: Hi, Does neo4j provide some way for adding listeners to the transaction lifecycle? We would like to intercept when transacions are commited, created and rolledback to provide our own functionality for example ensure that a given node property is always set or some other properties are within a range. Most ORM solutions like hibernate allow devs to register to events in the system to which they can react when certain events are triggered. We need such functionality in general for Traversers, Transactions, Inserts, Updates, Cache etc... ___ Neo 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 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Raul Raja -- Raul Raja ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] LuceneIndexService dependencies on EmbeddedGraphDatabase
Thanks for your response Mattias. I hope you don't mind my critical notes so far. For the last week, I have been working with Neo4J and really appreciate this product, while knowing it is at a 1.0 stage. The underlying machinery seems pretty mature for a 1.0 version, but some parts show it has not been exposed to thousands of different implementations yet. So I hope my finding some corner cases helps iron out some of those issues for upcoming releases. With respect to the meta layer, I would be interested in seeing a validator. So far I have not found such a component in the Neo4J code stack. Do you have plans to create one? I am willing to contribute code, even if it means using Java instead of Scala for a change. It seems a meta schema validator can only work once the event frame work is hooked up to the rest of the machinery. I have looked at the org.neo4j.kernel.impl.event package, but this seems to be referenced only once, registering the event manager within the kernel config. Do you have a timeline for the event framework? I know it is intended for version 1.1, but working on a validator doesn't necessarily have to wait until the final release of 1.1. Kind regards, Niels Hoogeveen Date: Mon, 15 Mar 2010 11:30:04 +0100 From: matt...@neotechnology.com To: user@lists.neo4j.org Subject: Re: [Neo] LuceneIndexService dependencies on EmbeddedGraphDatabase Yep, LuceneIndexService needs to register itself as an XA resource and needs the XA datasource manager from the EmbeddedGraphDatabase class. This isn't exposed in the GraphDatabaseService interface as of yet, but things like this are in the pipeline to be fixed. 2010/3/14 Niels Hoogeveen pd_aficion...@hotmail.com: I tried to wrap the EmbeddedGraphDatabase in a different class implementing the GraphDatabaseService interface. When using LuceneIndexService I get a class cast exception, because internally LuceneIndexService casts any instance of GraphDatabaseService to EmbeddedGraphDatabase. I would expect when the LuceneIndexService constructor requires a GraphDatabaseService that any class implementing that interface would work, otherwise the constructor should require an EmbeddedGraphDatabase instance. Kind regards, Niels Hoogeveen _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Calling org.neo4j.graphdb.index.Index#remove in a beforeCommit event, allowed ?
I know, exception can get swallowed at some point in there. I'll try to make that better in some way. 2010/9/20 Andreas Ronge andreas.ro...@jayway.se Sorry, found the bug in my code. It's rather difficult to debug when using the neo4j event framework since the stack trace doesn't give you much clues of what went wrong. It may be something that has occurred earlier that causes the problem, like calling methods on a deleted node. Cheers Andreas On Mon, Sep 20, 2010 at 4:12 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Andreas, that is strange. In the beforeCommit, there should be a Transaction open already. Also, are you deleting the Node in the same thread or a new one? Mattias, any comment on that? Cheers, /peter neubauer COO and Sales, Neo Technology 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Fri, Sep 17, 2010 at 6:05 AM, Andreas Ronge andreas.ro...@jayway.se wrote: Hi Is it not possible to call org.neo4j.graphdb.index.Index#remove when it's triggered from a beforeCommit event ? I get the following exception: (The TxData object contains the removed property (removedNodeProperties) that I want lucene to remove from it's index with the remove method.) class org.neo4j.graphdb.NotInTransactionException'; Message: null; StackTrace: org.neo4j.graphdb.NotInTransactionException at org.neo4j.index.impl.lucene.ConnectionBroker.acquireResourceConnection(ConnectionBroker.java:32) at org.neo4j.index.impl.lucene.LuceneIndex.getConnection(LuceneIndex.java:55) at org.neo4j.index.impl.lucene.LuceneIndex.remove(LuceneIndex.java:108) at org.neo4j.kernel.impl.core.TransactionEventsSyncHook.beforeCompletion(TransactionEventsSyncHook.java:76) at org.neo4j.kernel.impl.transaction.TransactionImpl.doBeforeCompletion(TransactionImpl.java:342) at org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:569) at org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:104) at org.neo4j.kernel.EmbeddedGraphDbImpl$TransactionImpl.finish(EmbeddedGraphDbImpl.java:513) 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.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:508) I have probably done something stupid. Cheers ___ 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] Need Node.isDeleted() again ...
2010/12/19 Mattias Persson matt...@neotechnology.com 2010/12/19 Andreas Ronge andreas.ro...@gmail.com Thanks ! but maybe it will be slower if one only have one deleted node in a tx ? Want it fast both for small and huge transactions is it not possible to find out if a node is deleted or not without using an internal collection ? This solution doesn't sacrifice anything. I just switched the use of ArrayListNode to HashSetNode so that #contains is fast. Just to clarify: when a transaction committs and there are one or more event listeners registered a TransactionData object will be populated with created/deleted nodes/relationships and assigned properties and all that. Previously deleted nodes/rels were collected and just put in an ArrayList which isn't fast at doing #contains on of course. So I just use HashSet instead and viola. On Sunday, December 19, 2010, Mattias Persson matt...@neotechnology.com wrote: I just added TransactionData#isDeleted(Node) and TransactionData#isDeleted(Relationship) and made the internal collection to hold the deleted entities a HashSet for fast lookups. 2010/12/15 Mattias Persson matt...@neotechnology.com 2010/12/14 Andreas Ronge andreas.ro...@gmail.com Hi I'm still struggling with not having a Node.isDeleted() method in the API. Here is an example where I need this method: I'm using the event framework to implemented a simple rule system. When a node/relationship changes it can trigger an action like setting a property on another node. That node must not have been deleted (in the same transaction). The only way to detect if a node has been deleted is to loop through the org.neo4j.graphdb.event.TransactionData#deletedNodes() which feel clumsy. Another solution might be to change the Event API to make this easier (and faster ?) to do ? Yes, maybe the data in TransactionData could be a little better, f.ex. exposing a method #nodeIsDeleted(Node) and many more of those? I mostly need the isDeleted() method in my unit tests where I want to delete every node after a test, or test if a node exist or not. /Andreas ___ 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 -- 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 -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com -- 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] OSGi and Neo4j - superbundle approach
Nicolas, just pushed some more initialization along your lines, and have the test running with the output: [~/code/neo/neo4j-osgi/examples] $mvn clean test [INFO] Scanning for projects... [INFO] [INFO] Building Neo4j OSGi examples [INFO]task-segment: [clean, test] [INFO] [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting /Users/peterneubauer/code/neo/neo4j-osgi/examples/target [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:test' is invalid. Its dependencies (if any) will NOT be available to the current build. [WARNING] POM for 'biz.aQute:bndlib:pom:1.15.0:test' is invalid. Its dependencies (if any) will NOT be available to the current build. [INFO] [enforcer:enforce {execution: enforce-maven}] [INFO] [license:check {execution: check-licenses}] [INFO] Checking licenses... [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/main/resources [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/main/resources/META-INF [INFO] Copying 0 resource to META-INF [INFO] [compiler:compile {execution: default-compile}] [INFO] No sources to compile [INFO] [bundle:manifest {execution: bundle-manifest}] [WARNING] Warning in manifest for org.neo4j.examples:neo4j-osgi-examples:jar:0.1-SNAPSHOT : Superfluous export-package instructions: [null.*] [WARNING] Warning in manifest for org.neo4j.examples:neo4j-osgi-examples:jar:0.1-SNAPSHOT : Did not find matching referal for * [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/test/resources [INFO] Copying 0 resource to META-INF [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Compiling 3 source files to /Users/peterneubauer/code/neo/neo4j-osgi/examples/target/test-classes [INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: /Users/peterneubauer/code/neo/neo4j-osgi/examples/target/surefire-reports --- T E S T S --- Running org.neo4j.examples.osgi.OSGiTest 300 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 2.1.0) created. Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/exam/pax-exam-container-rbc/2.1.0/pax-exam-container-rbc-2.1.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/exam/pax-exam-extender-service/2.1.0/pax-exam-extender-service-2.1.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as /Users/peterneubauer/.m2/repository/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.logging:pax-logging-api:jar:1.6.2) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/logging/pax-logging-api/1.6.2/pax-logging-api-1.6.2.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.logging:pax-logging-service:jar:1.6.2) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/logging/pax-logging-service/1.6.2/pax-logging-service-1.6.2.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.neo4j:neo4j-osgi-bundle:jar:0.1-SNAPSHOT) as /Users/peterneubauer/.m2/repository/org/neo4j/neo4j-osgi-bundle/0.1-SNAPSHOT/neo4j-osgi-bundle-0.1-SNAPSHOT.jar [org.ops4j.pax.exam.rbc.internal.Activator] : Name, port or host is null. So this RBC remains inactive. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED [Framework Event
Re: [Neo4j] [Neo] TransactionEventHandler and Spring transaction handling
Antonis, Just committed some bug fixes in the event framework and hopefully this also solves the problem you experienced when using Spring. Could you please try the latest neo4j-kernel 1.1-SNAPSHOT to see if it works? To answer your other question the handler is called in the same thread and you can access node properties in the afterCommit() call (we changed so reads without a running transaction are possible). Regards, Johan On Thu, May 20, 2010 at 2:56 PM, Antonis Lempesis ant...@di.uoa.gr wrote: To further clarify, I run 2 tests. In the first test, my objects were configured using spring + I had the @Transactional annotation in the test method. In the second test, I configured the same objects manually and also started and commited the transaction before and after calling the test method. In both cases, my handler got a TransactionData object (not null), but in the second case tData.assignedNodeProperties().hasNext() returned true while in the first it returned false. thanks for your support, Antonis PS 2 questions: is the handler called in a different thread? And, in afterCommit() method, can I access the node properties in the TransactionData object? Since the transaction is commited (I guess finished), shouldn't I get an NotInTransaction exception? On 5/20/10 3:38 PM, Johan Svensson wrote: Hi, I have not tried to reproduce this but just looking at the code I think it is a bug so thanks for reporting it! The synchronization hook that gathers the transaction data gets registered in the call to GraphDatabaseService.beginTx() but when using Spring (with that configuration) UserTransaction (old JTA) will be called directly so no events will be collected. Will fix this very soon. -Johan On Wed, May 19, 2010 at 5:49 PM, Antonis Lempesisant...@di.uoa.gr wrote: Hello all, I have set up spring to handle transactions for neo4j (according to the imdb example) and it works fine. When I read about the new events framework, I checked out the latest revision (4421) and tried to register my TransactionEventHandler that simply prints the number of created nodes. The weird thing is that when I test this in a simple junit test case, the TransactionData I get contains the correct data. When I do the same thing using the spring configuration, the TransactionData is empty. Any ideas? Thanks, Antonis ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [Neo] Event framework has landed
2010/6/11 Atle Prange atle.pra...@gmail.com: Regarding the performance: I have tried to tweak Babudb, but could not get any more out of it than you did. I guess when you put 5M entries at once, there is only so much tweaking one can do. (At least for babudb). It seems odd though, since babudb is a less complicated framework, with less features. We should contact the babudb guys and ask why we see the results that we see. Regarding keys: Having one entry in the db for each value will give the fastest update speed, but will be slower for a large number of nodes with the same value. Having an entry with all the ids will make a large entry, causing more bytes to be written to disk for every update. I tried having keys without the value in them (also making the index only support zero or one value per key) and it was very fast. If this approach would support multiple ids in a value, insertion speed would be even slower (due to lookup for every insert). But it would definately be an interesting implementation to use for one-to-one lookups! Also I noticed that insertion speed degrades quite heavily around 5M entries. Numbers: 1000 lookups (in an index with 5M key/value pairs): 30-40ms (0.03 ms/lookup) that is quite impressive and may be worth implementing as an index provider for such indices. On Fri, Jun 11, 2010 at 1:51 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: On Fri, Jun 11, 2010 at 12:54 PM, Mattias Persson matt...@neotechnology.com wrote: BabuDb has a db.prefixLookup( key|value| ) method so that's the one I'm using. I wonder how well that scales. I'd like to see some performance figures from indexing massive volumes and then doing lookup based on prefixLookup. -- 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 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] [Neo] Event framework has landed
I have given the information about the benchmark to the babudb guys. Hopefully we will have a performance war coming up. atle On Tue, Jun 15, 2010 at 10:50 AM, Mattias Persson matt...@neotechnology.com wrote: 2010/6/11 Atle Prange atle.pra...@gmail.com: Regarding the performance: I have tried to tweak Babudb, but could not get any more out of it than you did. I guess when you put 5M entries at once, there is only so much tweaking one can do. (At least for babudb). It seems odd though, since babudb is a less complicated framework, with less features. We should contact the babudb guys and ask why we see the results that we see. Regarding keys: Having one entry in the db for each value will give the fastest update speed, but will be slower for a large number of nodes with the same value. Having an entry with all the ids will make a large entry, causing more bytes to be written to disk for every update. I tried having keys without the value in them (also making the index only support zero or one value per key) and it was very fast. If this approach would support multiple ids in a value, insertion speed would be even slower (due to lookup for every insert). But it would definately be an interesting implementation to use for one-to-one lookups! Also I noticed that insertion speed degrades quite heavily around 5M entries. Numbers: 1000 lookups (in an index with 5M key/value pairs): 30-40ms (0.03 ms/lookup) that is quite impressive and may be worth implementing as an index provider for such indices. On Fri, Jun 11, 2010 at 1:51 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: On Fri, Jun 11, 2010 at 12:54 PM, Mattias Persson matt...@neotechnology.com wrote: BabuDb has a db.prefixLookup( key|value| ) method so that's the one I'm using. I wonder how well that scales. I'd like to see some performance figures from indexing massive volumes and then doing lookup based on prefixLookup. -- 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 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] [Neo] Event framework has landed
On Fri, Jun 11, 2010 at 12:20 PM, Mattias Persson matt...@neotechnology.com wrote: I tried performance of BabuDB recently. I'm not very used to key-value stores, but I chose this layout of the keys/values: key: key|value|id value: id I might be missing something here, but from my interpretation, what you are saying here is that: The key is created by combining the index key, the index value and the id of the indexed node i.e. if I do: indexService.index( graphdb.getNodeById( 17 ), name, Tobias ); The key in this case would be: name|Tobias|17 Then I want to do lookup: for (Node node : indexService.getNodes( name, Tobias )) { ... } How would I construct the key then? The reason I'm doing index lookup is because I don't know the node id. So I'm obviously missing some key thing that makes this work. The way I would design something like this is to let the key be a combination of index key and index value, then let the value be a list of ids. But I don't know what the concurrency aspects would be for BaduDB in this case. Is there a way to lock an entry while modifying it, or are there CAS operations that could be uses? Cheers, -- 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
Re: [Neo4j] Max De Marzi's Neo4j Server Ruby bindings
Hi That's interesting ! Would be cool to try to use the same API as neo4j.rb. But I think only a small part of the neo4j.rb API would be possible to implement using the REST API. Example, the traversals (which is done in javascript) and indexing/rules which uses the event framework would be impossible to implement (?) /Andreas On Sat, Nov 20, 2010 at 5:10 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Hi all, follow Max's comment on the Neo4j Server announcement, https://rubygems.org/gems/neography I just wanted to point out his Ruby bindings at https://github.com/maxdemarzi/neography Feel free to try it out and add some short intro on the Wiki, http://wiki.neo4j.org/content/Getting_Started, otherwise I can do it next week ... 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Implementing disambiguation algorithms in Neo4j
Tim, I don't know enough about disambiguation algos to point you in any special direction, but implementation-wise you could hook into the event framework, http://wiki.neo4j.org/content/Event_framework, in order to do e.g. graph matching queries upon any modifying transaction changing database content. HTH 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Tue, Feb 1, 2011 at 9:34 PM, Tim McNamara paperl...@timmcnamara.co.nz wrote: Say I have two nodes, { type: person, name: Neo } { type: person, name: Neo } Over time, I learn their locations. They both live in the same city. This increases the chances that they're the same person. However, over time it turns out that their ages differ, therefore it's far less likely that they are the same Neo. Is there anything inside of Neo4j that attempts to determine how close two nodes are? E.g. to what extent their subtrees and properties match? Additionally, can anyone suggest literature for algorithms for disambiguating the two entities? If I wanted to implement something that searches for similarities, that returns a probability of a match, can I do this within the database or should I implement it within the application? -- Tim McNamara @timClicks http://timmcnamara.co.nz ___ 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: [Neo] Event framework has landed
2010/5/1 Georg M. Sorst georgso...@gmx.de Hi Mattias, hi list that's just what I've been looking for, congratulations on the amazing progress you are making on Neo4j! I am actually trying to use the TransactionEventHandler to implement automatic versioning similar to what was discussed a while ago. The beforeCommit() handler seems like a perfect fit and provides all the data I need. Still, I have one problem: in beforeCommit() I fetch and increment a revision number that's stored in a special node and use that number to build the current revision structure. This brings up a few questions: 1. How atomic are Neo4j commits? Will two concurrent commits interfere when getting and incrementing the revision number? Transactions are atomic, but if transaction T1 reads a value and modifies it, but before it modifies it T2 reads the same value in the intent to modify it, there's a possibility that T1 and T2 will read the same value. And if they both increment the value they both will set it to the same value (which would not be the intended behavior). What you would need to do is to make sure T1 has a write-lock on the node which carries this revision property, that way T2 will have to wait until T1 is committed and will read the correct value. There's no nice way of locking a node other than setting/removing a property or creating/deleting relationships on it, so I'd say an ugly, but perfectly working way would be to do something like this: nodeWithRevision.removeProperty( a dummy property ); int counter = (Integer) nodeWithRevision.getProperty( revision ); so that neo4j is forced to take a write-lock on that node before getting the counter property. A nicer way will be exposed soon to do this instead! 2. How can I return the revision number from the TransactionEventHandler so I can use it in the caller (my service classes in this case)? I'd say it'd be better if the service classes could read the revision from the node which has the revision directly, that way you'd always get the committed value. Maybe your handler could have a getRevision() method which reads the revision property from that revision node. 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? I don't know what you mean by pass data to the transaction if it would not be to store something in the graph, f.ex. a property on a node. What exactly do you mean by that? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
Guys, I have tracked down the issues now to the actual thing. https://github.com/neo4j/neo4j-osgi-examples/blob/master/src/test/java/org/neo4j/examples/osgi/OSGiTest.javanow wraps lucene, and loads the Activator that tries to get and index, see https://github.com/neo4j/neo4j-osgi-examples/blob/master/src/test/java/org/neo4j/examples/osgi/Neo4jActivator.java. I now get [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles7256886623461679180UID - FrameworkEvent ERROR org.osgi.framework.BundleException: Exception in org.neo4j.examples.osgi.Neo4jActivator.start() of bundle BuildByTinyBundlestinybundles7256886623461679180UID. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337) Caused by: java.lang.IllegalArgumentException: No index provider 'lucene' found at org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:69) at org.neo4j.kernel.IndexManagerImpl.findIndexConfig(IndexManagerImpl.java:109) at org.neo4j.kernel.IndexManagerImpl.getOrCreateIndexConfig(IndexManagerImpl.java:171) at org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:242) at org.neo4j.examples.osgi.Neo4jActivator.start(Neo4jActivator.java:43) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774) ... 11 more which is exactly the kind of thing we are expecting. However, it seems the the ServiceLoader approach is not really compatible with OSGi, see http://jbossosgi.blogspot.com/2010/01/suns-serviceloader-and-how-it-relates.htmlfor details. Eelco, did you solve this problem in some nice way so I can adjust the tests? 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, Jun 8, 2011 at 2:01 PM, Super Wang wangxu...@gmail.com wrote: OK, I will try this later, thank you very much! On Wed, Jun 8, 2011 at 19:48, Peter Neubauer neubauer.pe...@gmail.com wrote: Yes. You need the latest kernel package which will be online in some hour, and git pull again in this project :-) Sent from my phone. On Jun 8, 2011 1:45 PM, Super Wang wangxu...@gmail.com wrote: Thanks Peter, and here's my error log: [INFO] Surefire report directory: D:\git\neo4j-osgi-examples\target\surefire-reports --- T E S T S --- Running org.neo4j.examples.osgi.OSGiTest 516 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 2.1.0) created. 2011-6-8 19:41:34 org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as D:\Software\Development\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax exam-container-rbc\2.1.0\pax-exam-container-rbc-2.1.0.jar 2011-6-8 19:41:41 org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as D:\Software\Development\SDKandLibrary\maven\repository\org\ops4j\pax\exam\ ax-exam-extender-service\2.1.0\pax-exam-extender-service-2.1.0.jar 2011-6-8 19:41:41 org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as D:\Software\Development
Re: [Neo] Mapping UUID to Neo node
On Sun, May 4, 2008 at 6:48 PM, Philip Jägenstedt [EMAIL PROTECTED] wrote: Now that I've finally gotten around to adding this index, l have some questions. First, it seems like IndexService and Index are used interchangably in your reply. IndexService doesn't have a getSingleNodeFor so it seems a getSingleNode with some constant key is what should be used. Is this correct? This is correct. I messed up the name of the getSingleNode() method. You should use IndexService and IndexService alone. An IndexService can maintain multiple indexes (typically one per property key) whereas the old Index only represents one particular index structure (~= for one particular key). So write all your stuff against the IndexService interface -- except of course the one place in your code when you new up the particular IndexService implementation of your choice (e.g. LuceneIndexService or NeoIndexService). This is done once, typically in application initialization code. Second, in my case the index can't be done in the artist factory as the id is not know at that time. This would be the case for any optional attribute. Instead it is created in the setId method on the Artist class. This must be a very common scenario and I suppose that you've all though of good design patterns for this. (http://wiki.neo4j.org/content/Advanced_Design_Guide seems completely outdated so I'm ignoring that.) Basically I don't want to sprinkle new NeoIndexService(neo) throughout my code, but my puny Java brain has thought all afternoon without figuring out something that fits nicely with the niceness of http://wiki.neo4j.org/content/Design_Guide It seems weird to me that an attribute named id would be optional, but anywho, I get your point. Unfortunately, there's currently no way you can get around having to manually let the IndexService know that an indexed property has changed. In the future, we're going to enable hooking an IndexService into the event framework and then declaratively specify property keys that it should watch and reindex. But for now, you're going to have to notify the IndexService (via the index() method) that an attribute has changed. This shouldn't be too invasive in your code, of course, since you probably don't index on a lot of attributes and you hopefully mutate those few attributes in a single, well-defined place. In your case it's probably just going to affect the setId() method, right? You wouldn't sprinkle new NeoIndexService(neo) in there though, as you wrote in your mail. Rather than instantiating a bunch of indexes, you'd get a reference to the one instance of IndexService that you've initialized in your app startup code. How do you get access to this instance? Ah, dependency resolution. Without theoretizing too much, there are roughly three ways you can go about this: 1. Access it through a singleton. This was the de-facto Right Solution(tm) of the mid 90s, inspired by the GoF Design Patterns book (p127). I.e. in a class, declare a public static IndexService getIndexService() and statically invoke it from whenever you need an IndexService, for example in your Arist.setId() method. 2. Well, then after a while the software development community decided that a) Singleton Was Broken for a component-oriented and unit-tested world and b) that dependency injection (aka inversion of control) was the right way to go. Lots have been written about this [1] but if you want to do it manually, you simply declare an IndexService parameter in the constructor of every class where you need to index stuff and then use that instance. For example: --- 8 --- public class Artist extends AbstractMusicBrainzEntity { private final Node underlyingNode; private final IndexService indexService; public Artist( Node underlyingNode, IndexService indexService ) { this.underlyingNode = underlyingNode; this.indexService = indexService; } public void setUuid( long uuid ) { Transaction tx = neo.beginTx(); try { underlyingNode.setProperty( PropertyKeys.UUID, uuid ); indexService.indexService( underlyingNode, PropertyKeys.UUID, uuid ); tx.success(); } finally { tx.finish(); } } } --- 8 --- 3. Instead of manually wiring your components and entities together, you could use a DI framework or container like Spring, or PicoContainer or Guice. Actual syntax depends on the framework, but it could look something like this: --- 8 --- public class Artist extends AbstractMusicBrainzEntity { @Autowired private IndexService indexService; ... @Transactional public void setUuid( long uuid ) { underlyingNode.setProperty( PropertyKeys.UUID, uuid ); indexService.indexService( underlyingNode, PropertyKeys.UUID, uuid ); } } --- 8 --- 1] This is probably not the best introduction today (it's really showing signs of its age)... but the seminal article that coined the term
Re: [Neo] Dispell the myth? FlockDB vs. Neo4j
Hmm...it's trivial to implement just user-followers in a relational db directly. Sounds like what they're mainly doing is just adding an easy partitioning layer. But they just released partitioning as a separate project, Gizzard: http://engineering.twitter.com/2010/04/introducing-gizzard-framework-for.html On that page they mention that FlockDb is built on top of Gizzard. I'm having trouble figuring out just what FlockDb really adds. On Tue, Apr 13, 2010 at 7:20 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, FlockDB seems to be focused on making the graph very flat (just user-followers) in order to be able to partition it. In that respect, it almost implements a document model. I think the most interesting to start with would be to implement it under Gremlin and run some algos on in in order to test. Emil will write up more on FlockDB, but I imagine the characteristics are more these of a Document DB than of a Graph DB. We will need to get a better grip on it before jumping to conclusions though. Cheers, /peter neubauer COO and Sales, Neo Technology 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://nosqleu.org- The biggest NOSQL event. Ever. http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party. On Tue, Apr 13, 2010 at 1:11 PM, Jeremy Day jeremy@gmail.com wrote: All, I haven't looked at FlockDB at all, but would it be possible to perhaps implement the Neo API on top of it? Jeremy On Tue, Apr 13, 2010 at 5:26 AM, Laurent Laborde kerdez...@gmail.com wrote: I just heavily twitted about it :) I'd call FlockDB a Key/Value/Relationship Store (KVRstore), but not a graphdb :) -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
Hi Mattias, thanks for your replies, finally getting back myself. Some clarifications about questions 2 and 3, getting data in and out of the transaction: What I am looking for is a way to do something like this: int revision = transaction.finish(commitMessage, userId); I've actually got this working by using a TransactionWrapper which intercepts these calls and puts the data in a global Thread map. The commit message and user id are then read out from the map by the transaction event handler. This works fine, but passing around the data in a global data structure just has an awful code smell. While another way would be to have the service layer read out the current revision and write the commit message itself etc. this smells just as bad IMHO with duplicated code and an unclear calling chain. So what I am looking for is a way to pass the data to the transaction as explained above, or maybe also something like: transaction.setAttribute(message, my commit message); tx.finish(); int revision = transaction.getAttribute(revision); Now I see my first snippet is quite specific to implementing a versioning system, but the later might be useful for other cases too. Is there any way to do this or is anything planned? Now that I've actually wrote about it my solution doesn't sound so bad really :) Best regards, Georg On 03.05.2010 17:03, Mattias Persson wrote: 2010/5/1 Georg M. Sorstgeorgso...@gmx.de Hi Mattias, hi list that's just what I've been looking for, congratulations on the amazing progress you are making on Neo4j! I am actually trying to use the TransactionEventHandler to implement automatic versioning similar to what was discussed a while ago. The beforeCommit() handler seems like a perfect fit and provides all the data I need. Still, I have one problem: in beforeCommit() I fetch and increment a revision number that's stored in a special node and use that number to build the current revision structure. This brings up a few questions: 1. How atomic are Neo4j commits? Will two concurrent commits interfere when getting and incrementing the revision number? Transactions are atomic, but if transaction T1 reads a value and modifies it, but before it modifies it T2 reads the same value in the intent to modify it, there's a possibility that T1 and T2 will read the same value. And if they both increment the value they both will set it to the same value (which would not be the intended behavior). What you would need to do is to make sure T1 has a write-lock on the node which carries this revision property, that way T2 will have to wait until T1 is committed and will read the correct value. There's no nice way of locking a node other than setting/removing a property or creating/deleting relationships on it, so I'd say an ugly, but perfectly working way would be to do something like this: nodeWithRevision.removeProperty( a dummy property ); int counter = (Integer) nodeWithRevision.getProperty( revision ); so that neo4j is forced to take a write-lock on that node before getting the counter property. A nicer way will be exposed soon to do this instead! 2. How can I return the revision number from the TransactionEventHandler so I can use it in the caller (my service classes in this case)? I'd say it'd be better if the service classes could read the revision from the node which has the revision directly, that way you'd always get the committed value. Maybe your handler could have a getRevision() method which reads the revision property from that revision node. 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? I don't know what you mean by pass data to the transaction if it would not be to store something in the graph, f.ex. a property on a node. What exactly do you mean by that? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which
Re: [Neo] Event framework has landed
always get the committed value. Maybe your handler could have a getRevision() method which reads the revision property from that revision node. 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? I don't know what you mean by pass data to the transaction if it would not be to store something in the graph, f.ex. a property on a node. What exactly do you mean by that? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
. There's no nice way of locking a node other than setting/removing a property or creating/deleting relationships on it, so I'd say an ugly, but perfectly working way would be to do something like this: nodeWithRevision.removeProperty( a dummy property ); int counter = (Integer) nodeWithRevision.getProperty( revision ); so that neo4j is forced to take a write-lock on that node before getting the counter property. A nicer way will be exposed soon to do this instead! 2. How can I return the revision number from the TransactionEventHandler so I can use it in the caller (my service classes in this case)? I'd say it'd be better if the service classes could read the revision from the node which has the revision directly, that way you'd always get the committed value. Maybe your handler could have a getRevision() method which reads the revision property from that revision node. 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? I don't know what you mean by pass data to the transaction if it would not be to store something in the graph, f.ex. a property on a node. What exactly do you mean by that? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Mattias Persson, [matt...@neotechnology.com mailto:matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com http://www.neotechnology.com -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Event framework has landed
of locking a node other than setting/removing a property or creating/deleting relationships on it, so I'd say an ugly, but perfectly working way would be to do something like this: nodeWithRevision.removeProperty( a dummy property ); int counter = (Integer) nodeWithRevision.getProperty( revision ); so that neo4j is forced to take a write-lock on that node before getting the counter property. A nicer way will be exposed soon to do this instead! 2. How can I return the revision number from the TransactionEventHandler so I can use it in the caller (my service classes in this case)? I'd say it'd be better if the service classes could read the revision from the node which has the revision directly, that way you'd always get the committed value. Maybe your handler could have a getRevision() method which reads the revision property from that revision node. 3. The caller should be able to pass data to the transaction, for now just the commit message. Of course I can temporarily store this in a node or attach it to the thread etc. but that just seems wrong. How can I do this right? I don't know what you mean by pass data to the transaction if it would not be to store something in the graph, f.ex. a property on a node. What exactly do you mean by that? Thanks and best regards, Georg On 27.04.2010 10:15, Mattias Persson wrote: Hi everyone! I'm quite pleased to announce that the new event framework has been committed in kernel 1.1-SNAPSHOT. After feedback from you guys the framework got quite small and cosy. Here's a summary. *TransactionEventHandler* can be registered at a GraphDatabaseService and will thereafter recieve diffs of modifications made in each transaction before and after they are committed. The transaction can still be modified in beforeCommit() and that method can also throw an exception to prevent the transaction from committing, causing a TransactionFailureException to be thrown from the code which is committing the transaction. *KernelEventHandler* can be registered at a GraphDatabaseService and will receive notifications about when a shutdown is about to occur for the GraphhDatabaseService instance. It will also receive notifications about kernel panics which is a state which the kernel can come to from where it cannot continue without needing to be restarted. An example of such an error would be a hard drive breakdown or when no more space is left on the device the graph database is running on. The next step is to write an auto indexer for the IndexService so that that you won't have to do the manual indexService.index( node, key, value ) anymore. Another thing would be to remove (deprecate) the IndexService#shutdown() method as it no longer would be required. So it'd be great if you guys would try this out and tell us how it feels. -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Mattias Persson, [matt...@neotechnology.com mailto:matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com http://www.neotechnology.com -- Georg M. Sorst Dipl. Inf. (FH) http://vergiss-blackjack.de Ignaz-Harrer-Str. 13 / Top 19 5020 Salzburg Österreich Tel: +43 (0)650 / 53 47 200 -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-Executable to be in PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e,PaxExam-58c 8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-dbf64e 7-cd20-4ef2-b168-67003529bb2e and expression=org.ops4j.pax.exam.testforge.SingleClassProvider;probe [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601 to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-58cb8c d-3f19-4037-a869-cf6ca9c09601 and expression=org.ops4j.pax.exam.testforge.WaitForService;probe [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent STARTED [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-container-rbc\2.1.0\pax-exam-container-rbc-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as D:\Software\Dev lopment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-extender-service\2.1.0\pax-exam-extender-service-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as D:\Software\Development\SDKandL brary\maven\repository\org\osgi\org.osgi.compendium\4.2.0\org.osgi.compendium-4.2.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-api:jar:1.6.2) as D:\Software\Developmen \SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-api\1.6.2\pax-logging-api-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-service:jar:1.6.2) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-service\1.6.2\pax-logging-service-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1) as D:\Software\De elopment\SDKandLibrary\maven\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1\geronimo-jta_1.1_spec-1.1.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.neo4j:neo4j-kernel:jar:1.4.M03) as D:\Software\Development\SDKandLibra y\maven\repository\org\neo4j\neo4j-kernel\1.4.M03\neo4j-kernel-1.4.M03.jar [org.ops4j.pax.exam.rbc.internal.Activator] : Name, port or host is null. So this RBC remains inactive. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED [Framework Event Dispatcher] DEBUG [bundle@6] - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - FrameworkEvent ERROR org.osgi.framework.BundleException: The bundle org.neo4j.kernel_1.4.0.M03 [7] could not be resolved. Reason: Missing Constraint: Import-Package: co .sun.source.tree; version=0.0.0 at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317) at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent INSTALLED [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent RESOLVED [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-Executable to be in PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e,PaxExam-58c 8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-dbf64e 7-cd20-4ef2-b168-67003529bb2e and expression=org.ops4j.pax.exam.testforge.SingleClassProvider;probe [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601 to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-58cb8c d-3f19-4037-a869-cf6ca9c09601 and expression=org.ops4j.pax.exam.testforge.WaitForService;probe [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent STARTED [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-container-rbc\2.1.0\pax-exam-container-rbc-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as D:\Software\Dev lopment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-extender-service\2.1.0\pax-exam-extender-service-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as D:\Software\Development\SDKandL brary\maven\repository\org\osgi\org.osgi.compendium\4.2.0\org.osgi.compendium-4.2.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-api:jar:1.6.2) as D:\Software\Developmen \SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-api\1.6.2\pax-logging-api-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-service:jar:1.6.2) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-service\1.6.2\pax-logging-service-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1) as D:\Software\De elopment\SDKandLibrary\maven\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1\geronimo-jta_1.1_spec-1.1.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.neo4j:neo4j-kernel:jar:1.4.M03) as D:\Software\Development\SDKandLibra y\maven\repository\org\neo4j\neo4j-kernel\1.4.M03\neo4j-kernel-1.4.M03.jar [org.ops4j.pax.exam.rbc.internal.Activator] : Name, port or host is null. So this RBC remains inactive. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED [Framework Event Dispatcher] DEBUG [bundle@6] - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - FrameworkEvent ERROR org.osgi.framework.BundleException: The bundle org.neo4j.kernel_1.4.0.M03 [7] could not be resolved. Reason: Missing Constraint: Import-Package: co .sun.source.tree; version=0.0.0 at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317) at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374
Re: [Neo4j] How to embed neo4j to OSGI env without spring?
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1179) at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264) at java.lang.Thread.run(Thread.java:736) [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent INSTALLED [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent RESOLVED [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-Executable to be in PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e,PaxExam-58c 8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-dbf64ec7-cd20-4ef2-b168-67003529bb2e to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-dbf64e 7-cd20-4ef2-b168-67003529bb2e and expression=org.ops4j.pax.exam.testforge.SingleClassProvider;probe [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601 to be in PaxExam-dbf64ec7-cd20-4ef2-b16 -67003529bb2e,PaxExam-58cb8c7d-3f19-4037-a869-cf6ca9c09601, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature=PaxExam-58cb8c d-3f19-4037-a869-cf6ca9c09601 and expression=org.ops4j.pax.exam.testforge.WaitForService;probe [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - ServiceEvent REGISTERED [FelixDispatchQueue] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_3350335 - BundleEvent STARTED [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-container-rbc\2.1.0\pax-exam-container-rbc-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as D:\Software\Dev lopment\SDKandLibrary\maven\repository\org\ops4j\pax\exam\pax-exam-extender-service\2.1.0\pax-exam-extender-service-2.1.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as D:\Software\Development\SDKandL brary\maven\repository\org\osgi\org.osgi.compendium\4.2.0\org.osgi.compendium-4.2.0.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-api:jar:1.6.2) as D:\Software\Developmen \SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-api\1.6.2\pax-logging-api-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.ops4j.pax.logging:pax-logging-service:jar:1.6.2) as D:\Software\Develo ment\SDKandLibrary\maven\repository\org\ops4j\pax\logging\pax-logging-service\1.6.2\pax-logging-service-1.6.2.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1) as D:\Software\De elopment\SDKandLibrary\maven\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1\geronimo-jta_1.1_spec-1.1.jar [main] INFO org.ops4j.pax.url.mvn.internal.AetherBasedResolver - Resolved (org.neo4j:neo4j-kernel:jar:1.4.M03) as D:\Software\Development\SDKandLibra y\maven\repository\org\neo4j\neo4j-kernel\1.4.M03\neo4j-kernel-1.4.M03.jar [org.ops4j.pax.exam.rbc.internal.Activator] : Name, port or host is null. So this RBC remains inactive. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED [Framework Event Dispatcher] DEBUG [bundle@6] - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.kernel - FrameworkEvent ERROR org.osgi.framework.BundleException: The bundle org.neo4j.kernel_1.4.0.M03 [7] could not be resolved. Reason: Missing Constraint: Import-Package: co .sun.source.tree; version=0.0.0
Re: [Neo] General Question about neo4j
Tobias,Thank you for the informative reply! Im very glad that python is supported (crossing my fingers for some sort of django-like declarative syntax). Unfortunately I did run into an installation problem earlier. Not sure if you had a chance to fix it, but it turned out to be a missing URI tag in POM.xml and Elementtree appending namespaces to tags. Just discovered Allegrograph and it looks every bit as interesting (comes with python bindings too!) Would love to hear opinions/comments on it if any. Thanks again! Johny h. On Thu, Jun 11, 2009 at 5:27 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: On Wed, Jun 10, 2009 at 9:41 PM, johny ho jho...@gmail.com wrote: Hi, I came across Neo4j while reading some articles on CouchDB and other alternatives to RDMS. The idea that both nodes and relationships are first-class citizens is very exciting. Im going to experiment with it using Neo4j.py when i get the free time. Hi Johny, Yes, these are interesting times. I watch with great excitement as more and more people are getting interested in database models that in some way or another differ from the relational model that has dominated the area for such long time now. In particular I am of course happy to see the attention that goes to Neo4j, as in the case with you. Being the principal implementer of Neo4j.py, this makes me even more excited. I got back from a trip the US just yesterday, and am feeling just slightly jet lagged, otherwise I would have responded to your e-mail sooner. Meanwhile i have a couple of newbie questions that maybe somebody in the community could answer: 1. Node IDs. Quickly looking at the docs: Ids are garbage collected over time so are only guaranteed to be unique at a specific set of time. Does this mean that the only way to set a ID for a node that can be referenced later, for example invoice numbers, would be to use UUIDs (much like how CouchDB identifies its' documents)? There was an example on the wiki about auto-incrementing unique IDs, but isn't this also subject to race conditions? A node, once created keeps its ID until it is deleted. At this point the now unused ID may be reused by a new node. If you never delete the node in question you can rely on it having the same ID. IDs do, of course, not make much sense for many kinds of lookup, which is why we have the index utilities. When using Neo4j.py you will find that these are integrated into the experience. 2. Is it possible to to guarantee the uniqueness of a property? Something like email address as a login name for users? I guess i could always use an alternative thrid party authentication. There are no constraints of this sort in Neo core. Neither built into Neo4j.py. The easiest way to implement this is to use an index for that property. So each time where your code sets the e-mail property, it does an index lookup in the e-mail index. If the lookup returns a node you will know that the value was not unique. If None is returned then there is no node with that e-mail, and you can go ahead and add it. We have been discussing exposing an event framework that could be used to implement such a constraint system, or automatic indexing of specific properties for that matter. The core developer team is having a meetup this weekend where I will make sure that the event-subsystem gets discussed. At the last meetup we set the schedule for the event framework to be included in the beta 10 release. I don't want to make any guarantees though, since this could still change (although I find it unlikely). 3. Can i reference a node from a relationship? for example AKNOWSB, become A-KNOWS from SchoolB with School being a node. Relationships in Neo4j are strictly from one node to one other node. This fits most common uses cases and helps us keep the performance characteristics of the API predictable. The usual way you model this is by having the semanitc knowledge of this structure in your domain model, and insert an intermediate node representing the reification of the relationship. In your example this would become: Alice ---KNOWS--- (intermediate) ---KNOWS--- Bob | |--FROM--- School In your domain model you would *know* that a KNOWS-relationship always ends up in a node that has two incoming KNOWS-relationships, one for each person who knows the other (it is a bi-directed relationship, that is why both are incoming), and one FROM-relationship to a node representing where the two persons got to know each other. You will know that it has this structure because this is how you always create it in your domain model. Thank you for these questions, they will make a good addition to our ever-growing library of questions and answers. Isn't it great how you can be a contributor to a project simply by asking questions? We do
Re: [Neo4j] OSGi and Neo4j - superbundle approach
Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles to mvn clean install the bundle module. maven-bundle-plugin is complaining about bundle.namespace property not set. I've fixed it. Then when deploying it on Felix I had an error saying that javax.transaction couldn't be imported. Because this package is already included in superbundle, I've removed it explicitally from the Import-Package directive. You can see the changes here [2]. Then I tried to make my bundle activated using felix and the following bundles installed : g! lb START LEVEL 1 ID|State |Level|Name 0|Active | 0|System Bundle (3.2.2) 1|Active | 1|Neo4j OSGi default bundle (0.1.0.SNAPSHOT) 2|Active | 1|Apache Felix Bundle Repository (1.6.2) 3|Active | 1|Apache Felix Gogo Command (0.8.0) 4|Active | 1|Apache Felix Gogo Runtime (0.8.0) 5|Active | 1|Apache Felix Gogo Shell (0.8.0) 6|Resolved | 1|EscapeK - Neo4j OSGi how-to - Embedded client (0.0.1.SNAPSHOT) There are only felix core, neo4j superbundle and my test bundle. So when starting felix I get the following trace : Welcome to Apache Felix Gogo g! Opening database in embedded mode: 17 juil. 2011 14:57:08 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. Recovery started ... OK Populating it ... OK Hello, brave Neo4j world! ERROR: Bundle org.escapek.neo4j-osgi-howto.embedded-client [6] Error starting file:/Users/nico/Dev/felix-framework-3.2.2/bundle/org.escapek.neo4j-osgi-howto.embedded-client_0.0.1-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator
Re: [Neo4j] API Questions and a bit more
On Saturday, September 4, 2010, Paddy paddyf...@gmail.com wrote: Hi alex, Some interesting suggestions, As far as I'm aware the Neo4j reference node is needed to display graphs in neoclipse, That is the only reason i would use a reference node. I don't want tosound like arueing, but if that's the only reason, then it should definitely *not* be part of the API. The last test that was failing should work if you use the LuceneFulltextQueryIndexServicehttp://components.neo4j.org/neo4j-index/apidocs/org/neo4j/index/lucene/LuceneFulltextQueryIndexService.html fulltextIndex = new LuceneFulltextQueryIndexService(gds); This part is getting even more confusing now :(. There are 2 Lucene IndexServices in the neo4j 1.1 distro and there's an additional one in the components. Anyone could explain what each of them is offeringand if they can be combined? ElasticSearch looks really good. How would you integrate ElasticSearch with neo4j? I'm a newbie to Neo4j so I'm not sure I know the right answer to this question. As far as I read, there're probably two ways to integrate the two: - using the same approach as the IndexService - use the Neo4j events framework for automatically index/update ElasticSearch (unfortunately I don't know much about the event framework to say if this would work or not though) Bests, :- alex cheers Paddy 2010/9/3 Alexandru Popescu ☀ the.mindstorm.mailingl...@gmail.com On Friday, September 3, 2010, rick.bullo...@burningskysoftware.com wrote: 1. They are durable but not permanent, in the sense that if a node is deleted, its ID will be re-used, unlike autoincremented keys in a database, which are typically not re-used. Perhaps a poor choice of words. In fact if I'm reading this right, they are both durable and permanent: as long as the node exist it will always be associated with that ID. The only caveat is that IDs can be reused once their initial node was purged from the system. This is a very important aspect as I can imagine many systems that can use a small subset of the existing nodes as entry points. Basically by using the cached IDs you'll be able to get to these without the need of using indexing/traversals. 3. Third parameter = value of the K-V pair you're using to index the node. I figured that out myself, but I still believe that the new method I've suggested would be welcome. Real question is: how many time you store a set of properties in the node, but want to index it by a completely unrelated/not persistent value? I'd speculate that this scenario is very very rare. 4. The reference node is merely one approach to a graph structure. You can have any number of standalone nodes. Reasonable to allow deleting the default reference node, though it might be a good idea to make this a configurable option on DB creation. If the reference node is not mandatory then why creating it by default? If you take as a reference the most well known hierarchical model, the FS, there it makes a lot of sense to have a root node (which is undeletable). But as I read this and noticed from the tests, the Neo4j reference node serves no purpose at all. 5/6. Haven't done much with Lucene yet, about to get started soon. Please keep sharing your experiences. Considering whether or not to use SOLR, also. I want to keep things as simple as possible, so for my current experiments I'll not look beyond what is already available in Neo4j. This aside, if I'd be to look into using a 3rd party indexing tool, my first option would be ElasticSearch (disclaimer: I do know the lead developer of ElasticSearch and his experience in indexing tools). I hope others will jump in and comment/answer on my suggestions and questions. Thanks, :- alex Original Message Subject: [Neo4j] API Questions and a bit more From: Alexandru_Popescu_â [1]the.mindstorm.mailingl...@gmail.com Date: Fri, September 03, 2010 4:53 am To: [2]u...@lists.neo4j.org Hi all, Last night I had some time to play with Neo4j (1.1) API. I do have a couple of questions and comments that I'd like to share with you: 1. The documentation I've found mentions that `Node` IDs are not permanent. I'm wondering why are IDs exposed them? 2. I was surprised to see a `Node`.delete() failing. The reason was it had relationships. I think adding a method `Node`.delete(boolean force) would make code much easier. The method would automatically: - remove all relationships - clean up indexes Note 1: I've been able to implement locally such a method in an utility class and it seems to work without any problems. Anyways another thing that I've found a bit weird was that I had to use ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] API Questions and a bit more
Hi Alex, Yes neo4j and lucene is confusing to start but it is very good when combined.: ) It would be good to see if it could integrated, elasticsearch sounds good Thanks Paddy On 5 Sep 2010, at 02:14, Alexandru Popescu ☀the.mindstorm.mailingl...@gmail.com wrote: On Saturday, September 4, 2010, Paddy paddyf...@gmail.com wrote: Hi alex, Some interesting suggestions, As far as I'm aware the Neo4j reference node is needed to display graphs in neoclipse, That is the only reason i would use a reference node. I don't want tosound like arueing, but if that's the only reason, then it should definitely *not* be part of the API. The last test that was failing should work if you use the LuceneFulltextQueryIndexServicehttp://components.neo4j.org/neo4j-index/apidocs/org/neo4j/index/lucene/LuceneFulltextQueryIndexService.html fulltextIndex = new LuceneFulltextQueryIndexService(gds); This part is getting even more confusing now :(. There are 2 Lucene IndexServices in the neo4j 1.1 distro and there's an additional one in the components. Anyone could explain what each of them is offeringand if they can be combined? ElasticSearch looks really good. How would you integrate ElasticSearch with neo4j? I'm a newbie to Neo4j so I'm not sure I know the right answer to this question. As far as I read, there're probably two ways to integrate the two: - using the same approach as the IndexService - use the Neo4j events framework for automatically index/update ElasticSearch (unfortunately I don't know much about the event framework to say if this would work or not though) Bests, :- alex cheers Paddy 2010/9/3 Alexandru Popescu ☀ the.mindstorm.mailingl...@gmail.com On Friday, September 3, 2010, rick.bullo...@burningskysoftware.com wrote: 1. They are durable but not permanent, in the sense that if a node is deleted, its ID will be re-used, unlike autoincremented keys in a database, which are typically not re-used. Perhaps a poor choice of words. In fact if I'm reading this right, they are both durable and permanent: as long as the node exist it will always be associated with that ID. The only caveat is that IDs can be reused once their initial node was purged from the system. This is a very important aspect as I can imagine many systems that can use a small subset of the existing nodes as entry points. Basically by using the cached IDs you'll be able to get to these without the need of using indexing/traversals. 3. Third parameter = value of the K-V pair you're using to index the node. I figured that out myself, but I still believe that the new method I've suggested would be welcome. Real question is: how many time you store a set of properties in the node, but want to index it by a completely unrelated/not persistent value? I'd speculate that this scenario is very very rare. 4. The reference node is merely one approach to a graph structure. You can have any number of standalone nodes. Reasonable to allow deleting the default reference node, though it might be a good idea to make this a configurable option on DB creation. If the reference node is not mandatory then why creating it by default? If you take as a reference the most well known hierarchical model, the FS, there it makes a lot of sense to have a root node (which is undeletable). But as I read this and noticed from the tests, the Neo4j reference node serves no purpose at all. 5/6. Haven't done much with Lucene yet, about to get started soon. Please keep sharing your experiences. Considering whether or not to use SOLR, also. I want to keep things as simple as possible, so for my current experiments I'll not look beyond what is already available in Neo4j. This aside, if I'd be to look into using a 3rd party indexing tool, my first option would be ElasticSearch (disclaimer: I do know the lead developer of ElasticSearch and his experience in indexing tools). I hope others will jump in and comment/answer on my suggestions and questions. Thanks, :- alex Original Message Subject: [Neo4j] API Questions and a bit more From: Alexandru_Popescu_â [1]the.mindstorm.mailingl...@gmail.com Date: Fri, September 03, 2010 4:53 am To: [2]u...@lists.neo4j.org Hi all, Last night I had some time to play with Neo4j (1.1) API. I do have a couple of questions and comments that I'd like to share with you: 1. The documentation I've found mentions that `Node` IDs are not permanent. I'm wondering why are IDs exposed them? 2. I was surprised to see a `Node`.delete() failing. The reason was it had relationships. I think adding a method `Node`.delete(boolean force) would make code much easier. The method would automatically: - remove all relationships - clean up indexes Note 1: I've been able to implement locally such a method in an utility class and it seems
Re: [Neo4j] Max De Marzi's Neo4j Server Ruby bindings
Very cool Max! WDYT about adding a node and relationship representation other than the response body to the return values? I would love to do this: require 'rubygems' require neography @neo = Neography::Rest.new() max = @neo.create_node(age = 31, name = Max) puts max peter = @neo.create_node(name = Peter) puts peter @neo.create_relationship(friends, max, peter) Do you think that is easy to do? 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Sat, Nov 20, 2010 at 11:19 PM, Max De Marzi Jr. maxdema...@gmail.com wrote: My idea was to just get a simple Rest wrapper started, and then build it out proper Node, Relationship and etc. sticking to the conventions you have already created with neo4j.rb. I originally started down that path, but then decided to build a base layer first, and then get help building on top of that ( I don't have your mad ruby skills). Using the Rest API is limited (at this point) so there's only so much we can do. I think Neography can work for simple scenarios and be a gateway to Neo4j.rb. I'll add that to the readme. On Sat, Nov 20, 2010 at 3:30 PM, Andreas Ronge andreas.ro...@gmail.com wrote: Hi That's interesting ! Would be cool to try to use the same API as neo4j.rb. But I think only a small part of the neo4j.rb API would be possible to implement using the REST API. Example, the traversals (which is done in javascript) and indexing/rules which uses the event framework would be impossible to implement (?) /Andreas On Sat, Nov 20, 2010 at 5:10 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Hi all, follow Max's comment on the Neo4j Server announcement, https://rubygems.org/gems/neography I just wanted to point out his Ruby bindings at https://github.com/maxdemarzi/neography Feel free to try it out and add some short intro on the Wiki, http://wiki.neo4j.org/content/Getting_Started, otherwise I can do it next week ... 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Index Performance(Was: Event framework has landed)
Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static void insert( int num, int start ) throws Exception { long t = System.currentTimeMillis(); BabuDBInsertGroup group = db.createInsertGroup(); for (int i = start; i (num + start); i++) { long id = i; group.addInsert( 0, key( id, key, value + i % 1 ), fastToBytes( id ) ); } db.insert( group, null ).get(); System.out.println( insert time ( + num + ): + (System.currentTimeMillis() - t) ); } public static void deleteFileOrDirectory( File file ) { if (!file.exists()) { return; } if (file.isDirectory()) { for (File child : file.listFiles()) { deleteFileOrDirectory( child ); } file.delete(); } else { file.delete
Re: [Neo4j] Index Performance(Was: Event framework has landed)
I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static void insert( int num, int start ) throws Exception { long t = System.currentTimeMillis(); BabuDBInsertGroup group = db.createInsertGroup(); for (int i = start; i (num + start); i++) { long id = i; group.addInsert( 0, key( id, key, value + i % 1 ), fastToBytes( id ) ); } db.insert( group, null ).get(); System.out.println( insert time ( + num + ): + (System.currentTimeMillis() - t) ); } public static void deleteFileOrDirectory( File file ) { if (!file.exists()) { return; } if (file.isDirectory()) { for (File child : file.listFiles
Re: [Neo4j] Index Performance(Was: Event framework has landed)
Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static void insert( int num, int start ) throws Exception { long t = System.currentTimeMillis(); BabuDBInsertGroup group = db.createInsertGroup(); for (int i = start; i (num + start); i++) { long id = i; group.addInsert( 0, key( id, key, value + i % 1 ), fastToBytes( id ) ); } db.insert( group, null ).get(); System.out.println( insert time ( + num + ): + (System.currentTimeMillis() - t) ); } public static void deleteFileOrDirectory( File file
Re: [Neo4j] Index Performance(Was: Event framework has landed)
2010/6/23 Atle Prange atle.pra...@gmail.com Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static void insert( int num, int start ) throws Exception { long t = System.currentTimeMillis(); BabuDBInsertGroup group = db.createInsertGroup(); for (int i = start; i (num + start); i++) { long id = i
Re: [Neo4j] Index Performance(Was: Event framework has landed)
I guess i have to brush the dust of my tree knowledge then... -atle On Thu, 2010-06-24 at 09:43 +0200, Mattias Persson wrote: 2010/6/23 Atle Prange atle.pra...@gmail.com Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static
Re: [Neo4j] OSGi and Neo4j - superbundle approach
Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles to mvn clean install the bundle module. maven-bundle-plugin is complaining about bundle.namespace property not set. I've fixed it. Then when deploying it on Felix I had an error saying that javax.transaction couldn't be imported. Because this package is already included in superbundle, I've removed it explicitally from the Import-Package directive. You can see the changes here [2]. Then I tried to make my bundle activated using felix and the following bundles installed : g! lb START LEVEL 1 ID|State |Level|Name 0|Active |0|System Bundle (3.2.2) 1|Active |1|Neo4j OSGi default bundle (0.1.0.SNAPSHOT) 2|Active |1|Apache Felix Bundle Repository (1.6.2) 3|Active |1|Apache Felix Gogo Command (0.8.0) 4|Active |1|Apache Felix Gogo Runtime (0.8.0) 5|Active |1|Apache Felix Gogo Shell (0.8.0) 6|Resolved |1|EscapeK - Neo4j OSGi how-to - Embedded client (0.0.1.SNAPSHOT) There are only felix core, neo4j superbundle and my test bundle. So when starting felix I get the following trace : Welcome to Apache Felix Gogo g! Opening database in embedded mode: 17 juil. 2011 14:57:08 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. Recovery started ... OK Populating it ... OK Hello, brave Neo4j world! ERROR: Bundle org.escapek.neo4j-osgi-howto.embedded-client [6] Error starting file:/Users/nico/Dev/felix-framework-3.2.2/bundle/org.escapek.neo4j-osgi-howto.embedded-client_0.0.1-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle org.escapek.neo4j-osgi-howto.embedded-client [6].) java.lang.IllegalArgumentException: No index provider 'lucene' found at org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76
Re: [Neo4j] OSGi and Neo4j - superbundle approach
Hello everyone May I chime in here... We are really interested to see neo4j working in an OSGi environment esp. together with Spring Data Graph. After an unsuccessful attempt to get it up and running a couple of weeks ago we gave it another chance today after seeing this post and after a whole day of debugging and fiddling around with manifests and template.mf and osgi.bnd we have - hurray - a running neo4j and Spring Data Graph setup in Virgo (based on Equinox). Regarding the error with the missing lucene index Provider (java.lang.IllegalArgumentException: No index provider 'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles
Re: [Neo4j] OSGi and Neo4j - superbundle approach
Hi Jean-Pierre, sorry for the inconvenience, the Tinybundles version is not yet released by the OPS4J team, so you can build it yourself from https://github.com/ops4j/org.ops4j.pax.tinybundles with mvn clean install Feedback is appreciated! 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, Jul 20, 2011 at 9:12 PM, Jean-Pierre Bergamin jpberga...@gmail.com wrote: Hello everyone May I chime in here... We are really interested to see neo4j working in an OSGi environment esp. together with Spring Data Graph. After an unsuccessful attempt to get it up and running a couple of weeks ago we gave it another chance today after seeing this post and after a whole day of debugging and fiddling around with manifests and template.mf and osgi.bnd we have - hurray - a running neo4j and Spring Data Graph setup in Virgo (based on Equinox). Regarding the error with the missing lucene index Provider (java.lang.IllegalArgumentException: No index provider 'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content
Re: [Neo4j] Max De Marzi's Neo4j Server Ruby bindings
Very cool, that was fast turnaround! It seems if the node[data][age] and @neo.get_id(node) methods move to the nodes themselves, the whole things looks almost identical to the native API, as Andreas is noticing, node[age] node.id I'm always amazed by how little code there is in Ruby. Grmpf. Good work Max! Btw, do you all think there should be an @neo.deleteAll function for testing and getting a clean slate? That maybe could be expressed in the REST API from the server in order to minimize roundtrips ... useful? 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Sun, Nov 21, 2010 at 9:27 PM, Max De Marzi Jr. maxdema...@gmail.com wrote: Ok, it's in 0.0.3 I'm not returning proper objects, but instead just added a get_id method that will take a hash, a string or a number and figure out it's id. So your code above runs. On Sun, Nov 21, 2010 at 4:16 AM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Very cool Max! WDYT about adding a node and relationship representation other than the response body to the return values? I would love to do this: require 'rubygems' require neography @neo = Neography::Rest.new() max = @neo.create_node(age = 31, name = Max) puts max peter = @neo.create_node(name = Peter) puts peter @neo.create_relationship(friends, max, peter) Do you think that is easy to do? 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Sat, Nov 20, 2010 at 11:19 PM, Max De Marzi Jr. maxdema...@gmail.com wrote: My idea was to just get a simple Rest wrapper started, and then build it out proper Node, Relationship and etc. sticking to the conventions you have already created with neo4j.rb. I originally started down that path, but then decided to build a base layer first, and then get help building on top of that ( I don't have your mad ruby skills). Using the Rest API is limited (at this point) so there's only so much we can do. I think Neography can work for simple scenarios and be a gateway to Neo4j.rb. I'll add that to the readme. On Sat, Nov 20, 2010 at 3:30 PM, Andreas Ronge andreas.ro...@gmail.com wrote: Hi That's interesting ! Would be cool to try to use the same API as neo4j.rb. But I think only a small part of the neo4j.rb API would be possible to implement using the REST API. Example, the traversals (which is done in javascript) and indexing/rules which uses the event framework would be impossible to implement (?) /Andreas On Sat, Nov 20, 2010 at 5:10 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Hi all, follow Max's comment on the Neo4j Server announcement, https://rubygems.org/gems/neography I just wanted to point out his Ruby bindings at https://github.com/maxdemarzi/neography Feel free to try it out and add some short intro on the Wiki, http://wiki.neo4j.org/content/Getting_Started, otherwise I can do it next week ... 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://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email to neo4...@googlegroups.com. To unsubscribe from this group, send email to neo4jrb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en. -- You received this message because you are subscribed to the Google Groups neo4jrb group. To post to this group, send email
Re: [Neo4j] Creating and managing external index
Avi, we are in the process to get out a nicer base framework for transactional index creation, and an index provider for redis. Meanwhile, if you want, you could look into the BerkelyDB index that I tried to cook together (no guarantees there), https://github.com/peterneubauer/bdb-index and see if that is something to contemplate? 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 - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Mon, Nov 21, 2011 at 2:40 AM, Avi Shai unicornrainbowche...@gmail.com wrote: What is the best way to create an external index but only for certain nodes? Really I want something like the in-graph data structures, but instead it will be stored in another database(s). I am in essence indexing only a sub-graph or a straight list of nodes. I then want to use these indexes as entry points in some cases rather than traversing. I understand that there is already Lucene, but I have data that is better suited to other indexes. I still want to use Lucene for full-text, just not for anything else. I am currently taking a stab at implementing the blueprint index interfaces (manual, automatic), but for another purpose. If I am always updating these indexes, but only for certain vertex types, what is the best integration point? In my data service classes/lower level neo4j stuff, or in a server event handler to plug-in the transaction? What about for all vertices? I guess I understand how to write the index classes but not about the best way of consuming them, and not if they apply well for lots of partial, smaller indexes. For instance, I want to store data as temporal values, with the most recent data first for a group of nodes. I'm not doing Twitter or a blog, but either is a good enough analogy. If I post something with a given tag, I want to index all the nodes that have been tagged by that tag (tag edge) in temporal order for example to create a recently tagged feed or a recently seen users feed that contains the users that have recently tagged using that tag. I could store this data in Redis exactly how I want and have a hot set in memory that can then be used either directly in some pages in my app, or as an entry point into neo4j for more complex queries. These indexes probably require lots of writes and I wanted to also avoid locking related nodes on any updates. Currently part of the reason I'm doing this is I have lots of super nodes in my design. I've patched this some by keeping counts in node properties and adding proxy nodes as mini-partions to reduce the number of relationships. I've also looked at things like combining common nodes together as junctions, but there are too many permutations to scale probably. Anyway, if I use in-graph indexes, I have to update my indexes every insertion or update. I'm going to try out indexed relationships, and I think it will help, but with respect, I don't think it will scale well or fit my use cases, especially for indexes where data drops out because the size is fixed (like a fixed list). I feel that creating index structures in the graph is nice, but it will severely balloon the graph. Moreover, I want to save resources on the servers running neo for graph traversals and other graph activities and I would rather use other clustered servers to store huge amounts of index data in memory. One other idea is to use another neo4j instance as an index to itself, but I think the characteristics of what I am doing are better suited in some cases for Redis (temporal lists) or Mongo (hierarchical metrics) depending the use-case. Example: pulling down linear lists of time-data by page and sorting front to back or back to front. I know that's a lot, but I wanted to at least give some detail beyond what I've already read here in all the old posts I've dug through this week. Any feedback? Thanks. -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Creating-and-managing-external-index-tp3523613p3523613.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] Index Performance(Was: Event framework has landed)
? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next(); fastToLong( entry.getValue() ); } } System.out.println( num + lookups: + (System.currentTimeMillis() - t) ); } private static void insert( int num, int start ) throws Exception { long t = System.currentTimeMillis(); BabuDBInsertGroup group = db.createInsertGroup(); for (int i = start; i (num + start); i
Re: [Neo4j] Index Performance(Was: Event framework has landed)
AM, Atle Prange atle.pra...@gmail.com wrote: I guess i have to brush the dust of my tree knowledge then... -atle On Thu, 2010-06-24 at 09:43 +0200, Mattias Persson wrote: 2010/6/23 Atle Prange atle.pra...@gmail.com Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup( int num, int start ) throws Exception { long t = System.currentTimeMillis(); for (int i = start; i (start + num); i++) { IteratorEntrybyte[], byte[] entries = db.prefixLookup( 0, lookupKey( key, value + i ), null ).get(); while (entries.hasNext()) { Entrybyte[], byte[] entry = entries.next
Re: [Neo4j] Index Performance(Was: Event framework has landed)
; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } } On Thu, Jun 24, 2010 at 11:29 AM, Atle Prange atle.pra...@gmail.com wrote: I guess i have to brush the dust of my tree knowledge then... -atle On Thu, 2010-06-24 at 09:43 +0200, Mattias Persson wrote: 2010/6/23 Atle Prange atle.pra...@gmail.com Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } private static byte[] lookupKey( String key, Object value ) { return String.valueOf( key + | + value + | ).getBytes(); } private static byte[] key( long id, String key, Object value ) { return String.valueOf( key + | + value + | + id ).getBytes(); } private static void lookup
Re: [Neo4j] Timeline index
Very good points. But I must admit that there is a demand for automatic indexing. I personally am not using it, but I would like prepared indexes, indexes that can be configured up front and then just add the node. I see your point about this implying more schema (in the index preparation), but I do not see that as avoidable. I think (or hope) that for automatic indexes, the criteria for how a node qualifies for indexing would be defined by the developer, hopefully with code, so it can be very general and flexible. For example, I guess that whenever a node is added to the graph, an event is triggered to pass the node to any listeners that look for patterns to match. For performance I guess there should be some simple patterns like the existence of some property to index, but it would be good if the user can define the code to be called, so more complex cases can be considered, like exploring the local sub-graph and indexing based on some more complex criteria. Certainly the user will then have the power to hurt performance, but that is currently the case anyway :-) On Mon, May 9, 2011 at 8:07 PM, Niels Hoogeveen pd_aficion...@hotmail.comwrote: Automatic indexes could be a very nice feature, though personally I would very much like to maintain the ability to manually index nodes and relationships. There are situations where I store a different value in a property than I store in the index (string properties containing html tags, but indexes that store those same values with the html tags stripped). There are also situations where the indexed node is not the node that actually contains the property being indexed (eg. in quad-store layout, a value node contains the property, but the related node is used in the index). I can also conceive of indexes where there is not even a stored property value involved. Having an automatic index would certainly make things easier in some scenarios, but it's not easy to create an automatic indexing mechanism that works for all possible use cases. I am also a little bit concerned about such a feature, because it would result in schema-creep. One of the most powerful features I find in Neo4J is how storage and schema are completely independent. In fact the store can be used without any schema at all, while at the same time the store can be used to persist a schema if that is needed. One of the things I disliked about table based databases is the mixing of storage and schema. It is impossible to define an entity without defining a table, which immediately creates a schema entity. Having strict separation of storage and schema is one of the reasons NOSQL databases are so flexible. Such separation makes it possible to invent different types of schemata for different use cases. When I still used relational databases, I always ended up replicating the schema facility of the underlying database to add more meta information to the database. Being able to roll my own schema facility is therefore one of the key features that made Neo4J such an attractive option. If more schema facilities would eventually creep into the kernel, those advantages would slowly dissipate. Date: Mon, 9 May 2011 18:34:10 +0200 From: cr...@amanzi.com To: user@lists.neo4j.org Subject: Re: [Neo4j] Timeline index +10 for both if Neils responses. I think both external and in-graph indexes should be supported. The last time I talked to Mattias about this it sounded like the only really clean option for integrating them behind one API would be once automatic indexes are supported, because at that point indexes get configured up-front (like the BTree and RTree) and then simply used (behind the scenes in automated indexes). I'm hoping automatic indexes are planned for 1.4, then all of this can come together :-) On Mon, May 9, 2011 at 3:14 PM, Niels Hoogeveen pd_aficion...@hotmail.comwrote: Rick, I am looking forward to the results of your investigation. I see a need for both external search mechanisms (Lucene, and possible Solr), as well as in-graph search mechanisms based on constrained traversals (eg. Timeline index based on a Btree and the Rtree index used in neo4j-spatial). Any progress in either direction is most welcome. From: rick.bullo...@thingworx.com To: matt...@neotechnology.com; user@lists.neo4j.org Date: Mon, 9 May 2011 03:57:13 -0700 Subject: Re: [Neo4j] Timeline index Niels/Mattias: we are also exploring a Solr implementation for the index framework. There are some potential benefits using Solr in a large graph/HA/distributed scenario that we are investigating. The tough part is the distributed transactioning, though. - Reply message - From: Mattias Persson matt...@neotechnology.com Date: Mon, May 9, 2011 6:14 am Subject: [Neo4j] Timeline index To: Neo4j user discussions user@lists.neo4j.org 2011/4/12 Niels Hoogeveen
Re: [Neo4j] Timeline index
I'm confident that given the history of neo4j, there will be no forcing of a schema :-) And I'm thinking of previous developments that added convenience and value, like jo4neo, neo4j.rb, even the meta-model. Useful, but no-one was ever forced or even pushed to use them. I hope the new automatic indexing will be likewise a convenient alternative to consider. On Mon, May 9, 2011 at 10:17 PM, Niels Hoogeveen pd_aficion...@hotmail.comwrote: Mattias/Craig, Of course I don't want to deny people the opportunity to have easy indexing features, as long as it remains optional and doesn't lead to schema-creep into the Neo4j kernel. Having configurable event handlers that allow for automatic indexing, while maintaining the possibility to manually maintain indices sounds like a reasonable solution. Over the last year I have dedicated many hours to create my own schema driven CMS in Neo4J, which makes me vigilant to make sure the Neo4j kernel remains as schema-less as possible. see also: http://lists.neo4j.org/pipermail/user/2011-May/008431.html Adding schema/type/class information to Neo4j is likely to be much in demand the bigger applications grow, and I applaud all developments in those directions, as long as they remain optional. The schema needs for my application may differ very much from the schema needs in other applications, making it important not to add too many assumptions in the neo4j kernel. Having property keys and relationship labels is, as far as I am concerned the right dose of schema at the kernel level. Date: Mon, 9 May 2011 20:50:56 +0200 From: matt...@neotechnology.com To: user@lists.neo4j.org Subject: Re: [Neo4j] Timeline index 2011/5/9 Niels Hoogeveen pd_aficion...@hotmail.com Automatic indexes could be a very nice feature, though personally I would very much like to maintain the ability to manually index nodes and relationships. There are situations where I store a different value in a property than I store in the index (string properties containing html tags, but indexes that store those same values with the html tags stripped). There are also situations where the indexed node is not the node that actually contains the property being indexed (eg. in quad-store layout, a value node contains the property, but the related node is used in the index). I can also conceive of indexes where there is not even a stored property value involved. Having an automatic index would certainly make things easier in some scenarios, but it's not easy to create an automatic indexing mechanism that works for all possible use cases. I am also a little bit concerned about such a feature, because it would result in schema-creep. One of the most powerful features I find in Neo4J is how storage and schema are completely independent. In fact the store can be used without any schema at all, while at the same time the store can be used to persist a schema if that is needed. One of the things I disliked about table based databases is the mixing of storage and schema. It is impossible to define an entity without defining a table, which immediately creates a schema entity. Having strict separation of storage and schema is one of the reasons NOSQL databases are so flexible. Such separation makes it possible to invent different types of schemata for different use cases. When I still used relational databases, I always ended up replicating the schema facility of the underlying database to add more meta information to the database. Being able to roll my own schema facility is therefore one of the key features that made Neo4J such an attractive option. If more schema facilities would eventually creep into the kernel, those advantages would slowly dissipate. These issues with automatic indexing are exactly those that I struggle with when I try to get my head around automatic indexing. At its core I don't like it, because it takes away control, but for 80% of the use cases I think it'd be useful. I don't think that neo4j will ever be strict schematic in any way, although some inferred types could possibly be implemented in some way, via TransactionEventHandlers. A couple of months ago I played around with auto indexing as a lab project and ended up with the exact same solution that Craig just replied with. So I'd say that or the middle way of preconfiguring indexes up front covers would pretty much make most people happy IMHO. Date: Mon, 9 May 2011 18:34:10 +0200 From: cr...@amanzi.com To: user@lists.neo4j.org Subject: Re: [Neo4j] Timeline index +10 for both if Neils responses. I think both external and in-graph indexes should be supported. The last time I talked to Mattias about this it sounded like the only really clean option for integrating them behind one API would be once automatic indexes
Re: [Neo4j] OSGi and Neo4j - superbundle approach
, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles to mvn clean install the bundle module. maven-bundle-plugin is complaining about bundle.namespace property not set. I've fixed it. Then when deploying it on Felix I had an error saying that javax.transaction couldn't be imported. Because this package is already included in superbundle, I've removed it explicitally from the Import-Package directive. You can see the changes here [2]. Then I tried to make my bundle activated using felix and the following bundles installed : g! lb START LEVEL 1 ID|State |Level|Name 0|Active | 0|System Bundle (3.2.2) 1|Active | 1|Neo4j OSGi default bundle (0.1.0.SNAPSHOT) 2|Active | 1|Apache Felix Bundle Repository (1.6.2) 3|Active | 1|Apache Felix Gogo Command (0.8.0) 4|Active | 1|Apache Felix Gogo Runtime (0.8.0) 5|Active | 1|Apache Felix Gogo Shell (0.8.0) 6|Resolved | 1|EscapeK - Neo4j OSGi how-to - Embedded client (0.0.1.SNAPSHOT) There are only felix core, neo4j superbundle and my test bundle. So when starting felix I get the following trace : Welcome to Apache Felix Gogo g! Opening database in embedded mode: 17 juil. 2011 14:57:08 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. Recovery started ... OK Populating it ... OK Hello, brave Neo4j world! ERROR: Bundle org.escapek.neo4j-osgi-howto.embedded-client [6] Error starting file:/Users/nico/Dev/felix-framework-3.2.2/bundle/org.escapek.neo4j-osgi-howto.embedded-client_0.0.1-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle org.escapek.neo4j-osgi-howto.embedded-client [6].) java.lang.IllegalArgumentException: No index provider 'lucene' found at org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76) at org.neo4j.kernel.IndexManagerImpl.findIndexConfig(IndexManagerImpl.java:116) at org.neo4j.kernel.IndexManagerImpl.getOrCreateIndexConfig
Re: [Neo4j] OSGi and Neo4j - superbundle approach
also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles to mvn clean install the bundle module. maven-bundle-plugin is complaining about bundle.namespace property not set. I've fixed it. Then when deploying it on Felix I had an error saying that javax.transaction couldn't be imported. Because this package is already included in superbundle, I've removed it explicitally from the Import-Package directive. You can see the changes here [2]. Then I tried to make my bundle activated using felix and the following bundles installed : g! lb START LEVEL 1 ID|State |Level|Name 0|Active | 0|System Bundle (3.2.2) 1|Active | 1|Neo4j OSGi default bundle (0.1.0.SNAPSHOT) 2|Active | 1|Apache Felix Bundle Repository (1.6.2) 3|Active | 1|Apache Felix Gogo Command (0.8.0) 4|Active | 1|Apache Felix Gogo Runtime (0.8.0) 5|Active | 1|Apache Felix Gogo Shell (0.8.0) 6|Resolved | 1|EscapeK - Neo4j OSGi how-to - Embedded client (0.0.1.SNAPSHOT) There are only felix core, neo4j superbundle and my test bundle. So when starting felix I get the following trace : Welcome to Apache Felix Gogo g! Opening database in embedded mode: 17 juil. 2011 14:57:08 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. Recovery started
Re: [Neo4j] OSGi and Neo4j - superbundle approach
'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal is to make my activator work when deployed on Felix with the neo4j superbundle. First of all, I had troubles to mvn clean install the bundle module. maven-bundle-plugin is complaining about bundle.namespace property not set. I've fixed it. Then when deploying it on Felix I had an error saying that javax.transaction couldn't be imported. Because this package is already included in superbundle, I've removed it explicitally from the Import-Package directive. You can see the changes here [2]. Then I tried to make my bundle activated using felix and the following bundles installed : g! lb START LEVEL 1 ID|State |Level|Name 0|Active | 0|System Bundle
Re: [Neo4j] OSGi and Neo4j - superbundle approach
to see neo4j working in an OSGi environment esp. together with Spring Data Graph. After an unsuccessful attempt to get it up and running a couple of weeks ago we gave it another chance today after seeing this post and after a whole day of debugging and fiddling around with manifests and template.mf and osgi.bnd we have - hurray - a running neo4j and Spring Data Graph setup in Virgo (based on Equinox). Regarding the error with the missing lucene index Provider (java.lang.IllegalArgumentException: No index provider 'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content/About_Contributor_License_Agreement ? 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 Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, Thanks for initiating this work on OSGi bundle. I've forked you repository and tried to make is work using this sample activator [1]. My goal
Re: [Neo4j] OSGi and Neo4j - superbundle approach
clean install Feedback is appreciated! 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, Jul 20, 2011 at 9:12 PM, Jean-Pierre Bergamin jpberga...@gmail.com wrote: Hello everyone May I chime in here... We are really interested to see neo4j working in an OSGi environment esp. together with Spring Data Graph. After an unsuccessful attempt to get it up and running a couple of weeks ago we gave it another chance today after seeing this post and after a whole day of debugging and fiddling around with manifests and template.mf and osgi.bnd we have - hurray - a running neo4j and Spring Data Graph setup in Virgo (based on Equinox). Regarding the error with the missing lucene index Provider (java.lang.IllegalArgumentException: No index provider 'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also, in order to pull your changes, could you sign up as a committer, and send a mail according to http://wiki.neo4j.org/content
Re: [Neo4j] OSGi and Neo4j - superbundle approach
is not yet released by the OPS4J team, so you can build it yourself from https://github.com/ops4j/org.ops4j.pax.tinybundles with mvn clean install Feedback is appreciated! 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, Jul 20, 2011 at 9:12 PM, Jean-Pierre Bergamin jpberga...@gmail.com wrote: Hello everyone May I chime in here... We are really interested to see neo4j working in an OSGi environment esp. together with Spring Data Graph. After an unsuccessful attempt to get it up and running a couple of weeks ago we gave it another chance today after seeing this post and after a whole day of debugging and fiddling around with manifests and template.mf and osgi.bnd we have - hurray - a running neo4j and Spring Data Graph setup in Virgo (based on Equinox). Regarding the error with the missing lucene index Provider (java.lang.IllegalArgumentException: No index provider 'lucene' found) I also would like to refer to this discussion here: https://github.com/neo4j/community/commit/e8574e96315999ab04e1b484717bb2b1a3dfa9be#commitcomment-483325 I also had the No index provider 'lucene' found error with neo4j 1.4. With 1.3, the workaround was to export the org.neo4j.index.impl package, which is not working with 1.4. Instead I just registered an instance of LuceneIndexProvider from the lucene-index bundle as a osgi service. After doing this, this index provider can be found as an OSGi service by the kernel. We currently register this service within our application, which is probaby not the right solution. I think the lucene-index bundle should export the LuceneIndexProvider service itself, shouldn't it? I also tried to get your example up and running, but I have a missing dependency: Failure to find org.ops4j.pax:tinybundles:jar:1.0.0-SNAPSHOT. Which snapshot repository does contain the tinybundles jar? Best regards, James 2011/7/20 Peter Neubauer neubauer.pe...@gmail.com: Yup, have pulled and can see it. Thanks! Will ask the Toni for a way to cleanly shut down the framework so we can get both tests working. /peter On Mon, Jul 18, 2011 at 11:58 PM, Peter Neubauer neubauer.pe...@gmail.com wrote: Nicolas, I am away for 2 days, will try it out after that. Thanks for chipping in! /peter Sent from my phone. On Jul 18, 2011 9:43 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: Hi Peter, I've comited a new test case which work with a pre-built bundle. It currently fails because in OSGiTest class the first test case doesn't close the database, but if you remove the @Test before the first test case the second one will run and succeed. So the neo4j superbundle seems to work correctly, event if I don't know what's wrong when doing it by hand on the felix framework. This need more time to investigate. Don't hesitate to pull code if needed. Nicolas Le 17 juil. 2011 à 22:06, Peter Neubauer a écrit : Nicolas, the best would be to be able to emulate this in a test, too. Maybe classloading issues? Maybe forking the PaxExam test will reproduce the issue, or running you Felix setup as a testcase to trigger this? 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 Sun, Jul 17, 2011 at 9:21 PM, Nicolas Jouanin nicolas.joua...@gmail.com wrote: I've sent the CLA signup. The OSGiTest is working fine for me too. Problems come when taking the felix framework out of the box and deploying manually neo4j-osgi bundle with another bundle containing the same activator class. I made sure to deploy same bundles but I get java.lang.IllegalArgumentException: No index provider 'lucene' found when registring the IndexService. I think i miss a bundle which is created automatically by pax during the test case. May be lucene is missing. What do you think Le 17 juil. 2011 à 17:33, Peter Neubauer a écrit : Hi Nicolas, Have you been able to run https://github.com/njouanin/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java properly? It actually is running on Equinox, so let me try it with Felix ... back in a moment. Also
Re: [Neo4j] Index Performance(Was: Event framework has landed)
) { Document doc = searcher.doc( scoreDoc.doc ); long id = fastToLong( doc.getBinaryValue( _id_ ) ); } } reader.close(); System.out.println( num + hits: +hits+ time: + (System.currentTimeMillis() - t) ); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException { long value = 0; for (int i = 0; i array.length; i++) { value = 8; value ^= (long) array[i] 0xFF; } return value; } } On Thu, Jun 24, 2010 at 11:29 AM, Atle Prange atle.pra...@gmail.com wrote: I guess i have to brush the dust of my tree knowledge then... -atle On Thu, 2010-06-24 at 09:43 +0200, Mattias Persson wrote: 2010/6/23 Atle Prange atle.pra...@gmail.com Hm, i'll have to fix that... Any thoughts on a Trie implementation? Would it be able to compete? I have no idea on performance or what would be the best approach. I though your alphabet-relationship-types approach sounded quite interesting. Or as a b-tree or some other ??-tree. atle On Wed, Jun 23, 2010 at 11:04 AM, Mattias Persson matt...@neotechnology.com wrote: I think the lucene test is flawed since it never returns any results in lookup method. That's why it's so fast :) 2010/6/22 Atle Prange atle.pra...@gmail.com Started a new thread since the old got a bit long, if you want to catch up read the thread The event framework has landed. Okay, i changed the tests to reflect a bit more realistic usage. The tests first inserts 1M entries to create a base of data. After that it makes reads and writes 1000 entries a thousand times. BabuDB: First million: 4s 1000 inserts, 4ms 1000 lookups: 30ms Lucene: First million entries took 1 ms. This shows the async behavior of Lucene. 1000 inserts: about 4 seconds (!) 1000 lookups: under 1 ms. (All numbers extremely approximated, and the numbers can only be seen as relative performance indicators) This is what i excpected. Lucene is optimized towards collecting large amount of data batchwise, and then handle many searches. (Correct me if i am wrong) BabuDB just writes data and just reads them later on. The test can of course be flawed. BabuDB test: package org.ogrm.test; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map.Entry; import org.apache.commons.lang.math.RandomUtils; import org.xtreemfs.babudb.BabuDB; import org.xtreemfs.babudb.BabuDBException; import org.xtreemfs.babudb.BabuDBFactory; import org.xtreemfs.babudb.config.BabuDBConfig; import org.xtreemfs.babudb.log.DiskLogger.SyncMode; import org.xtreemfs.babudb.lsmdb.BabuDBInsertGroup; import org.xtreemfs.babudb.lsmdb.Database; public class TestBabuDb { private static Database db; public static void main( String[] args ) throws Exception { deleteFileOrDirectory( new File( babudb ) ); BabuDB babuDb = BabuDBFactory.createBabuDB( new BabuDBConfig( babudb/db, babudb/log, 1, 1024 * 1024 * 20, 10, SyncMode.ASYNC, 0, 0, false, 512, 1024 * 1024 * 100 ) ); db = babuDb.getDatabaseManager().createDatabase( test, 1 ); int init = 100; int num = 1000; int base = 0; int iterations = 1000; insert( init, base ); base = init; for (int i = 0; i iterations; i++) { lookup( num, base ); insert( num, base ); base = base + num; } db.shutdown(); babuDb.shutdown(); } private static byte[] fastToBytes( long value ) throws IOException { byte[] array = new byte[8]; for (int i = 0; i 8; i++) { array[7 - i] = (byte) (value (i * 8)); } return array; } private static long fastToLong( byte[] array ) throws IOException
Re: [Neo4j] User Digest, Vol 56, Issue 16
Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ 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 -- Message: 3 Date: Wed, 2 Nov 2011 11:05:02 -0700 From: Michael Rene Armida m...@marmida.com Subject: Re: [Neo4j] User Digest, Vol 56, Issue 12 To: user@lists.neo4j.org Message-ID: CAPeGkJ4Vm3gKHr=zlolbnrchdx51wnrb+hcfbfo-5p42e9u...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 I hadn't. I'm still confused
Re: [Neo4j] User Digest, Vol 56, Issue 16
Emil, I am not totally following your thoughts (would be great with an example in pictures). Have you looked at Cypher tree structure handling, e.g. http://docs.neo4j.org/chunked/snapshot/examples-acl-structures-in-graphs.html#_read_permission_example to find some inspiration? 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 - NOSQL for the Enterprise. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. On Wed, Nov 2, 2011 at 5:18 PM, Emil Dombagolla em...@hsenidoutsourcing.com wrote: Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how
Re: [Neo4j] User Digest, Vol 56, Issue 16
Something you could probably do is to return paths from cypher or traversal and then pick the nodes off the paths that you're interested in - from the path you get the tree-structure aka. the path's to the root of your tree. From the information extracted there you can build your composite object/structure which can then be rendered whatever technique you'd like to use. If I understood you correctly the challenge was how to keep the structural information which nodes are in which position of the hierarchy ? Cheers Michael Am 03.11.2011 um 01:18 schrieb Emil Dombagolla: Hi , Thanks Andreas Kollegger and Rick Bullotta, i am using vaadin framework. but the issue is.how to build a tree using nodes. becouse we are selecting nodes form different levels of the graph based on some conditions . then i have to merge child node with if the parent nodes are available in the current result. i think i have to do a algorithm for this. is there any easy api available with neo for this kind of task. Please help me with your soulutions. Thanka Emil On Thu, Nov 3, 2011 at 2:31 AM, user-requ...@lists.neo4j.org wrote: Send User mailing list submissions to user@lists.neo4j.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.neo4j.org/mailman/listinfo/user or, via email, send a message with subject or body 'help' to user-requ...@lists.neo4j.org You can reach the person managing the list at user-ow...@lists.neo4j.org When replying, please edit your Subject line so it is more specific than Re: Contents of User digest... Today's Topics: 1. Re: Tree structure (Andreas Kollegger) 2. Re: Tree structure (Rick Bullotta) 3. Re: User Digest, Vol 56, Issue 12 (Michael Rene Armida) 4. Re: Node Id generation deadlock (Cres) 5. zero fromDepth and toDepth (Alex) 6. Neo4j Installer in Neography (maxdemarzi) 7. Neo4j Events in November (Allison Sparrow) 8. Re: Neo4j Events in November (Peter Neubauer) -- Message: 1 Date: Wed, 2 Nov 2011 10:52:44 -0700 From: Andreas Kollegger andreas.kolleg...@neotechnology.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: ab950280-d372-40b0-b270-6cf81bde2...@neotechnology.com Content-Type: text/plain; charset=us-ascii Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Message: 2 Date: Wed, 2 Nov 2011 10:53:54 -0700 From: Rick Bullotta rick.bullo...@thingworx.com Subject: Re: [Neo4j] Tree structure To: Neo4j user discussions user@lists.neo4j.org Message-ID: 09df3402c845ec489a3323a06208f20d1b46e...@p3pw5ex1mb14.ex1.secureserver.net Content-Type: text/plain; charset=us-ascii I've used d3. You do need a bit of JQuery/Javascript skills to munge the data into a form the d3 libraries expect it, but the results are impressive if you do. From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On Behalf Of Andreas Kollegger [andreas.kolleg...@neotechnology.com] Sent: Wednesday, November 02, 2011 1:52 PM To: Neo4j user discussions Subject: Re: [Neo4j] Tree structure Hi Emil, Are you interested in displaying the tree structure in a web interface? You could either take a widget-approach using something like jstree ( http://www.jstree.com/) or a more model visualization using D3 ( http://mbostock.github.com/d3/ex/). Cheers, Andreas On Nov 2, 2011, at 9:36 AM, Emil Dombagolla wrote: Hi all, i need to display a tree structure , based on the nodes i retrieved from the database through traverse. Nodes are gathered from different levels of the graph. some of the nodes are having parent / child relation in the graph. so if my result containing such a relation i want to display it in a tree structure. Please help me on this and please give me your ideas how to solve this. Thanks a lot. Emil Dombagolla, ___ Neo4j mailing
Re: [Neo4j] Very Slow Transaction only on Windows
Hi Michael, your heap is smaller than that: see the line from messages.log: Thu Aug 11 12:05:17 PDT 2011: Physical mem: 3006MB, Heap size: 668MB Please provide your JVM with a larger heap setting like -Xmx4G Can you please upgrade your memory mapped config to take about 2G of that (in windows memory mapped memory is taken from the heap). If you start neo4j programmatically you can pass in a Map for that (see also http://wiki.neo4j.org/content/Configuration_Settings#Memory_mapped_I.2FO_settings) Current settings are in messages.log: Thu Aug 11 12:05:17 PDT 2011: neostore.nodestore.db.mapped_memory=20M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.arrays.mapped_memory=130M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.index.keys.mapped_memory=1M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.index.mapped_memory=1M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.mapped_memory=90M Thu Aug 11 12:05:17 PDT 2011: neostore.propertystore.db.strings.mapped_memory=130M Thu Aug 11 12:05:17 PDT 2011: neostore.relationshipstore.db.mapped_memory=100M I also saw you're running Java7 on that one, right now we have no performance tests on Java7. Just to mention it. Btw. even on Kei's Macbook it shouldn't take a second to add 1000 vertices. Rather around a few milliseconds. Don't know what kind of overhead, the blueprints / cytoscape managers around the neo4j core add. I'm blueprints has a auto-tx mode where there is a new tx per each operation and you have to disable that (if you use external tx-managment). Cheers Michael Am 14.08.2011 um 05:00 schrieb Michael Kirby: Hello, Here is my messages.log , I also recently got a new computer and it takes about 3 seconds on that one. The heap for it 1809 MB. Thu Aug 11 12:05:17 PDT 2011: Opened [target\neo4jDB\nioneo_logical.log.1] clean empty log, version=0 Thu Aug 11 12:05:17 PDT 2011: Opened [C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\neo4jDB\index\lucene.log.1] clean empty log, version=0 Thu Aug 11 12:05:17 PDT 2011: TM opening log: target\neo4jDB\tm_tx_log.2 Thu Aug 11 12:05:17 PDT 2011: --- CONFIGURATION START --- Thu Aug 11 12:05:17 PDT 2011: Physical mem: 3006MB, Heap size: 668MB Thu Aug 11 12:05:17 PDT 2011: Kernel version: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Operating System: Windows 7; version: 6.1; arch: amd64; cpus: 2 Thu Aug 11 12:05:17 PDT 2011: VM Name: Java HotSpot(TM) 64-Bit Server VM Thu Aug 11 12:05:17 PDT 2011: VM Vendor: Sun Microsystems Inc. Thu Aug 11 12:05:17 PDT 2011: VM Version: 17.0-b17 Thu Aug 11 12:05:17 PDT 2011: Boot Class Path: C:\Java\jdk1.6.0_21\jre\lib\resources.jar;C:\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Java\jdk1.6.0_21\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_21\jre\lib\jsse.jar;C:\Java\jdk1.6.0_21\jre\lib\jce.jar;C:\Java\jdk1.6.0_21\jre\lib\charsets.jar;C:\Java\jdk1.6.0_21\jre\classes Thu Aug 11 12:05:17 PDT 2011: Class Path: C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\test-classes;C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\classes;C:\Users\Michael\workspace\api-parent\model-api\target\classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\work-api\3.0.0-alpha6-SNAPSHOT\work-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-core\0.9\tinkerpop-blueprints-core-0.9.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-neo4j-graph\0.9\tinkerpop-blueprints-neo4j-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1.jar;C:\Users\Michael\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-lucene-index\1.4.1\neo4j-lucene-index-1. 4.1.jar;C:\Users\Michael\.m2\repository\org\apache\lucene\lucene-core\3.1.0\lucene-core-3.1.0.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-algo\1.4.1\neo4j-graph-algo-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-udc\1.4.1\neo4j-udc-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-matching\1.4.1\neo4j-graph-matching-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-cypher\1.4.1\neo4j-cypher-1.4.1.jar;C:\Users\Michael\.m2\repository\org\scala-lang\scala-library\2.9.0-1\scala-library-2.9.0-1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-jmx\1.4.1\neo4j-jmx-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1-tests.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-ha\1.3\neo4j-ha-1.3.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-backup\1.3\neo4j-backup-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\zookeeper\zookeeper\3.3.2\zookeeper-3.3.2.jar;C:\Users\Mi chael\.m2
Re: [Neo] Starting pain with Neo4j
out what went wrong before then.) How should we better phrase it to be more intuitive? Traditionally, we've sucked at our exception names (less) and messages (more). Please help us improve this by letting us know every time an exception wasn't helpful! Once everything was running I had two issues. The first was having to open a transaction just to read data seemed wrong. I see pure read data as being one of the most common tasks and if I am not going to be changing anything I don't see why I have to manage a transaction. Well, the problem is that whether reading data must be in the context of a transaction is dependent on the transaction's isolation level. For example, there are isolation levels where with pessimistic locking you want read locks to block both other writes and reads. I like grouping logical operations together in transactions. It's a good way to convey intent (all these things that I do logically belong together) and it allows the underlying infrastructure to do cool optimizations, like batch up flushes and reorder disk operations sequentially. I think the overarching issue is that using programmatic transactions kinda sucks for most cases. That's what we support out of the box, but we should integrate well with any JTA-compliant container so if you run something like Spring you can use declarative transactions.That really cleans up your code. Furthermore, Michael Hunger has experimented with a neat template-based API that miltigates the requirement of programmatic transactions, see http://components.neo4j.org/neo-template-api/. Secondly the property setting felt quite cumbersome, I would expect to be able to set multiple Properties via a MapString, type for example. I also think it should be part of the Core API to retrieve Nodes by Property although if I am reading the documentation correctly I think that might already be on your roadmap. Properties as a Map: Yea, I've wanted a node.propertiesAsMap() also a few times. But when I've thought it through I've always ended up with ambiguous (or at least non-intuitive) semantics for it. Maybe if we throw some more cycles at it we'll figure it out. We will improve the integration between index-util and the Neo4j kernel in the future, at least by bundling them up together in a convenience assembly (see above) and by using an event framework for keeping indexes in sync with the node space. Again it might be just to do with the name but I would not expect to have to explicitly shutdown an Embedded process. The shutdown should be on the finalizer for the server. Once an Embedded object goes out of scope it is, to my mind, not in use any longer. Well, it's really tricky to make that stable and easy to use on top of the JVM. We have very little control over the GC and in particular on Windows all hell breaks loose with open files. Idea: What if EmbeddedNeo's constructor registered a shutdown hook with the JVM to shutdown (if not already done) when the JVM exits? There's obvious goodness with that, but any bad consequences that I'm missing? Finally Traversing queries again felt quite heavyweight, I felt that some things like Direction.BOTH and StopEvaluator.END_OF_GRAPH could be assumed unless I stated otherwise. I felt that maybe a Traverser Builder would have helped my pain by creating Traversers with common characteristics quickly. The same is true of nodes as I kind of envisaged a builder that would build up a set of properties and perhaps even the relationships and the build the required node and store it. Hmm, yea. I've heard this come up before. I've opted so far to keep the API as clean, simple and compact as possible -- my reasoning is that it's really easy to layer stuff like this on top of the core API and if a lot of people really end up doing it, we'll move it into a component and if THAT ends up being used almost all the time, then we'll push it down into the core API. (Vote through code.) Would love to see your (or anyone else's) take on a builder API. (I think Michael may have included one in his neo-template-api component.) So to sum up, things I liked: a working graph database(!), relationships being first order. Things that were difficult: micromanging the database process, lack of lightweight query modes, ceremony for node creation. I don't know if I am going to get time next week but I might try and generate some code illustrating what I mean about wrapping the current API in something that assumes basic options until overridden. Would be great! Thanks a lot for the feedback! Cheers, -- Emil Eifrém, CEO [EMAIL PROTECTED] Neo Technology, www.neotechnology.com Cell: +46 733 462 271 | US: 206 403 8808 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Brainstorming on my project: neo4john
. Neo4j already supports Lucene, which is great for certain jobs (full text indexing, composite queries), but is probably (I would have to run tests to verify this assumption) slower than BDB when it comes to simple key-value mappings. Lucene is also not very good at handling unicity constraints, an area where a more regular key-value store like BDB has advantage too. from my superficial tests seems only 1ms slower than bdb All this is just about the tooling level of an application (fun in its own right, but it doesn't solve any real problems). Things become more interesting when we start looking at an actual application. I kind of agree, but from where I stand this tooling level seems like 90% of the entire job, I mean, once I have the foundating it's all about playing with it and adding the data(nodes) which depending on their context can be realtime programs running on their own So my question is, what use cases do you want to solve with your neo4john project. Any :) I don't know, anything that can be built upon a layer that is based on connectivity/accessibility, so practically anything I'd say, we should be able to model anything (without regard to how much it consumes in bytes) it should be doable, but at the same time the modeling itself would be the source code the javadoc and the binary , all in one :) Ok so big words, but, I don't know what use cases to think of, I would imagine my entire operating system built on this, disregard how slow it would be for now, just imagine it is built upon this tooling, the use cases and the tooling are practically one, such that you can built another tooling on top of another tooling and that tooling can help you build some application or other tooling ... Your example with buttons on a screen is a bit too high level, because it contains a lot more tooling than just neo4j and or BDB. You would need presentation (GUI or HTML) and reactiveness (how to respond to input) and you would need to somehow model your domain. yeah definitely those would be required to be built upon this, ... I mean, starting bottom-up like that, we'd see how and what needs to be built, like for example, the java code could parse a portion of the graph and execute it as if it were a script, but all the commands and inputs and outputs would be in the graph domain - the code is in the graph - represented by nodes and their rels - the input could be 1-to-1 mapped from keyboard and mouse directly in-graph such that when you press keys, they would be appended to some ordered list and in-graph-programs would be able to listen on those events when a list got an element appended or specifically this keybuffer list - the output could be newly created nodes or stuff like that basically could map the computer software and how it all works right now, on top of a graph, such that it's more accessible and you could see the structure. Like right now, if you would pick a random RAM address from memory, would be somewhat tough to tell which program is using it and from that program which structure which function and so on, but if the foundation would've been a graph we'd just parse the parents ie. incoming rels for that byte so to speak, which would likely be just a node not a byte... A graph could be alive, change its structures just like RAM changes its contents in response to programs, but with a graph I would be able to see exactly how it's composed and fiddle with it and most importantly understand it (almost)just by parsing it. So my suggestion would be to first list a couple of real world scenarios you want to solve with your neo4john project and then look at your tooling to see what trade-offs you need to make to implement it. You may need a mix of Neo4j, Lucene and BDB, but maybe you don't need all three to solve your particular problem. by tooling you mean neo4j, lucene or bdb ? or you mean the foundation ie. the final program that would be fed some input data and expected to get some output data ? in which case I'm not sure which would be the tooling which the data lol real world scenarios... like I don't know make any system, like a program (which say i'd usually do in java) but make it on top of neo4john, that is neo4john would be my foundation on which I make and base my program, say make it networking chat program or something that would create a 3D object; the tooling should be able to say interpret the graph and create what it says, I guess in a way it would be like an accessibility framework whatever this means heh, like 1-to-1 mapping between java code and graph nodes, such that manipulating graph-nodes would yield some result in the 3D world or ... well more like the the in-graph data is a higher level mapping on top of the lower level java/OS stuff for starters... still seems too generic as an example I don't know what examples to give you, you try and give an example and I'll see if it should be supported xD but generally, if you think about it we
Re: [Neo4j] Very Slow Transaction only on Windows
Thu Aug 11 12:05:17 PDT 2011: Operating System: Windows 7; version: 6.1; arch: amd64; cpus: 2 Thu Aug 11 12:05:17 PDT 2011: VM Name: Java HotSpot(TM) 64-Bit Server VM Thu Aug 11 12:05:17 PDT 2011: VM Vendor: Sun Microsystems Inc. Thu Aug 11 12:05:17 PDT 2011: VM Version: 17.0-b17 Thu Aug 11 12:05:17 PDT 2011: Boot Class Path: C:\Java\jdk1.6.0_21\jre\lib\resources.jar;C:\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Java\jdk1.6.0_21\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_21\jre\lib\jsse.jar;C:\Java\jdk1.6.0_21\jre\lib\jce.jar;C:\Java\jdk1.6.0_21\jre\lib\charsets.jar;C:\Java\jdk1.6.0_21\jre\classes Thu Aug 11 12:05:17 PDT 2011: Class Path: C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\test-classes;C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\classes;C:\Users\Michael\workspace\api-parent\model-api\target\classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\work-api\3.0.0-alpha6-SNAPSHOT\work-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-core\0.9\tinkerpop-blueprints-core-0.9.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-neo4j-graph\0.9\tinkerpop-blueprints-neo4j-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1.jar;C:\Users\Michael\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-lucene-index\1.4.1\neo4j-lucene-index-1. 4.1.jar;C:\Users\Michael\.m2\repository\org\apache\lucene\lucene-core\3.1.0\lucene-core-3.1.0.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-algo\1.4.1\neo4j-graph-algo-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-udc\1.4.1\neo4j-udc-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-matching\1.4.1\neo4j-graph-matching-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-cypher\1.4.1\neo4j-cypher-1.4.1.jar;C:\Users\Michael\.m2\repository\org\scala-lang\scala-library\2.9.0-1\scala-library-2.9.0-1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-jmx\1.4.1\neo4j-jmx-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1-tests.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-ha\1.3\neo4j-ha-1.3.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-backup\1.3\neo4j-backup-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\zookeeper\zookeeper\3.3.2\zookeeper-3.3.2.jar;C:\Users\Mi chael\.m2\repository\org\neo4j\neo4j-com\1.3\neo4j-com-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\servicemix\bundles\org.apache.servicemix.bundles.netty\3.2.3.Final_1\org.apache.servicemix.bundles.netty-3.2.3.Final_1.jar;C:\Users\Michael\.m2\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\Users\Michael\workspace\api-parent\model-api\target\test-classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT-tests.jar;C:\Users\Michael\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar;C:\Users\Michael\.m2\repository\org\mockito\mockito-all\1.8.5\mockito-all-1.8.5.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-sail-graph\0.9\tinkerpop-blueprints-sail-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\slf4j\slf4j-log4j12\1.5.6\slf4j-log4j12-1.5.6.jar;C:\Users\Michael\.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.jar;C:\Users\Michael\.m2\repository\org\o penrdf\sesame\sesame-sail-api\2.4.0\sesame-sail-api-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-query\2.4.0\sesame-query-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-rio-api\2.4.0\sesame-rio-api-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-queryalgebra-model\2.4.0\sesame-queryalgebra-model-2.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-collections\2.8.0\aduna-commons-collections-2.8.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-model\2.4.0\sesame-model-2.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-i18n\1.4.0\aduna-commons-i18n-1.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-iteration\2.10.0\aduna-commons-iteration-2.10.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-concurrent\2.7.0\aduna-commons-concurrent-2.7.0.jar;C:\Users\Michael\.m2\repository\info\aduna\co mmons\aduna-commons-lang\2.9.0\aduna-commons-lang-2.9.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-queryparser-sparql\2.4.0\sesame-queryparser-sparql-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-queryparser-api\2.4.0\sesame-queryparser-api-2.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-net\2.7.0\aduna-commons-net-2.7.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-text\2.7.0\aduna
Re: [Neo4j] Very Slow Transaction only on Windows
, version=0 Thu Aug 11 12:05:17 PDT 2011: TM opening log: target\neo4jDB\tm_tx_log.2 Thu Aug 11 12:05:17 PDT 2011: --- CONFIGURATION START --- Thu Aug 11 12:05:17 PDT 2011: Physical mem: 3006MB, Heap size: 668MB Thu Aug 11 12:05:17 PDT 2011: Kernel version: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Neo4j - Graph Database Kernel 1.4.1 Thu Aug 11 12:05:17 PDT 2011: Operating System: Windows 7; version: 6.1; arch: amd64; cpus: 2 Thu Aug 11 12:05:17 PDT 2011: VM Name: Java HotSpot(TM) 64-Bit Server VM Thu Aug 11 12:05:17 PDT 2011: VM Vendor: Sun Microsystems Inc. Thu Aug 11 12:05:17 PDT 2011: VM Version: 17.0-b17 Thu Aug 11 12:05:17 PDT 2011: Boot Class Path: C:\Java\jdk1.6.0_21\jre\lib\resources.jar;C:\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Java\jdk1.6.0_21\jre\lib\sunrsasign.jar;C:\Java\jdk1.6.0_21\jre\lib\jsse.jar;C:\Java\jdk1.6.0_21\jre\lib\jce.jar;C:\Java\jdk1.6.0_21\jre\lib\charsets.jar;C:\Java\jdk1.6.0_21\jre\classes Thu Aug 11 12:05:17 PDT 2011: Class Path: C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\test-classes;C:\Users\Michael\blueprints-graph-cytoscapeMaster\target\classes;C:\Users\Michael\workspace\api-parent\model-api\target\classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\work-api\3.0.0-alpha6-SNAPSHOT\work-api-3.0.0-alpha6-SNAPSHOT.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-core\0.9\tinkerpop-blueprints-core-0.9.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-neo4j-graph\0.9\tinkerpop-blueprints-neo4j-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1.jar;C:\Users\Michael\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-lucene-index\1.4.1\neo4j-lucene-index-1. 4.1.jar;C:\Users\Michael\.m2\repository\org\apache\lucene\lucene-core\3.1.0\lucene-core-3.1.0.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-algo\1.4.1\neo4j-graph-algo-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-udc\1.4.1\neo4j-udc-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-graph-matching\1.4.1\neo4j-graph-matching-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-cypher\1.4.1\neo4j-cypher-1.4.1.jar;C:\Users\Michael\.m2\repository\org\scala-lang\scala-library\2.9.0-1\scala-library-2.9.0-1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-jmx\1.4.1\neo4j-jmx-1.4.1.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-kernel\1.4.1\neo4j-kernel-1.4.1-tests.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-ha\1.3\neo4j-ha-1.3.jar;C:\Users\Michael\.m2\repository\org\neo4j\neo4j-backup\1.3\neo4j-backup-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\zookeeper\zookeeper\3.3.2\zookeeper-3.3.2.jar;C:\Users\Mi chael\.m2\repository\org\neo4j\neo4j-com\1.3\neo4j-com-1.3.jar;C:\Users\Michael\.m2\repository\org\apache\servicemix\bundles\org.apache.servicemix.bundles.netty\3.2.3.Final_1\org.apache.servicemix.bundles.netty-3.2.3.Final_1.jar;C:\Users\Michael\.m2\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\Users\Michael\workspace\api-parent\model-api\target\test-classes;C:\Users\Michael\.m2\repository\org\cytoscape\event-api\3.0.0-alpha6-SNAPSHOT\event-api-3.0.0-alpha6-SNAPSHOT-tests.jar;C:\Users\Michael\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar;C:\Users\Michael\.m2\repository\org\mockito\mockito-all\1.8.5\mockito-all-1.8.5.jar;C:\Users\Michael\.m2\repository\org\cytoscape\wrappers\tinkerpop-blueprints-sail-graph\0.9\tinkerpop-blueprints-sail-graph-0.9.jar;C:\Users\Michael\.m2\repository\org\slf4j\slf4j-log4j12\1.5.6\slf4j-log4j12-1.5.6.jar;C:\Users\Michael\.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.jar;C:\Users\Michael\.m2\repository\org\o penrdf\sesame\sesame-sail-api\2.4.0\sesame-sail-api-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-query\2.4.0\sesame-query-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-rio-api\2.4.0\sesame-rio-api-2.4.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-queryalgebra-model\2.4.0\sesame-queryalgebra-model-2.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-collections\2.8.0\aduna-commons-collections-2.8.0.jar;C:\Users\Michael\.m2\repository\org\openrdf\sesame\sesame-model\2.4.0\sesame-model-2.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-i18n\1.4.0\aduna-commons-i18n-1.4.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-iteration\2.10.0\aduna-commons-iteration-2.10.0.jar;C:\Users\Michael\.m2\repository\info\aduna\commons\aduna-commons-concurrent\2.7.0\aduna-commons-concurrent-2.7.0.jar;C:\Users\Michael\.m2\repository\info\aduna\co mmons\aduna-commons-lang\2.9.0\aduna-commons-lang-2.9.0.jar;C:\Users\Michael\.m2\repository