[Neo4j] Relationship[3] exist but relationship type[2] not found.

2011-09-06 Thread skarab77
Hi All,

I have get the following exception: 

Exception in thread AWT-EventQueue-0 org.neo4j.graphdb.NotFoundException: 
Relationship[1451488] exist but relationship type[2] not found.
at 
org.neo4j.kernel.impl.core.NodeManager.getRelForProxy(NodeManager.java:566)
at 
org.neo4j.kernel.impl.core.RelationshipProxy.getType(RelationshipProxy.java:75)

From this post 
(http://neo4j-community-discussions.438527.n3.nabble.com/Neo-NotFoundException-Question-td717235.html)
 I have learned that it can indicate that my neo4j instance is in the 
inconsistency state. Is it possible to fix this issue, is it possible to add 
somehow the missing relationship type?

Best Regards,
Wojtek
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Neo4j Spatial - GeoProcessing in the making

2011-09-06 Thread Peter Neubauer
Hi all,
while trying to come up with a good approach to GeoProcessing in Neo4j
Spatial as we wrap up Andreas Wilhelms work from the GSoC, we are
experimenting with a dataflow-based lazy approach (using the generic parts
of Tinkerpop pipes). This is broken up into filtering operations (that
filter out and search geometries) and processing operations (that
manipulate, change and create new geometries).

The first result after a day labbing looks like
https://github.com/neo4j/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/pipes/GeoPipesTest.java,
so basically we have something like

 @Test
public void count_all_geometries_in_a_layer()
{
assertEquals( 2, layer.filter().all().count() );
}
@Test
public void count_number_of_points_in_all_geometries_in_a_layer()
{
assertEquals( 24, layer.filter().all().process().countPoints() );
}


What do you think of this approach to provide a simple way to achieve more
complex operations? With the spatial index soon implementing lazy BBox
searches, we should be able to make this work in the filtering part. Maybe
there should be one more part, search() or index(), dropping back to the
starting points that already exist and that not really are taking any input
beside the search parameters?

In the geoprocessing part, we are currently looking into overriding pipe
implementations so that a simple default toPoints() will convert geometries
to Points using JTS, while a more specialized domain-level toPoints() (will
do that in the OSM model) can actually walk the graph to find out the points
that make up a geometry.

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.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Community - count me in!

2011-09-06 Thread Peter Neubauer
Hi all,
Over the last year, the graph community has seen a fantastic surge of
interest and activity. We feel that we can and must support all of you more
seriously, so I am stepping up as the first of the Neo Technology community
team, dedicating more of my time to explicit community support.

http://blog.neo4j.org/2011/09/neo4j-community-team-announcement.html

Good days to come everyone, it's an honor to work with you!

Cheers,

/peter neubauer

GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer

http://www.neo4j.org   - Your high performance graph database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Community - count me in!

2011-09-06 Thread Rick Bullotta
Congratulations, Peter!  There couldn't be a better champion for Neo4J and the 
community.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Peter Neubauer
Sent: Tuesday, September 06, 2011 10:33 AM
To: Neo4j user discussions; gremlin-users; neo4jrb
Subject: [Neo4j] Community - count me in!

Hi all,
Over the last year, the graph community has seen a fantastic surge of
interest and activity. We feel that we can and must support all of you more
seriously, so I am stepping up as the first of the Neo Technology community
team, dedicating more of my time to explicit community support.

http://blog.neo4j.org/2011/09/neo4j-community-team-announcement.html

Good days to come everyone, it's an honor to work with you!

Cheers,

/peter neubauer

GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer

http://www.neo4j.org   - Your high performance graph database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Neo4j Events this Week 09/06/2011

2011-09-06 Thread Allison Sparrow
***
Hi Everyone,

Here are the events organized for this week. If you have any questions
regarding participation, feel free to email me at alli...@neotechnology.com
*
*
*LONDON Keynote: Ian Robinson presents @Progressive .NET Tutorials*
Wednesday, 7 September @ 09:30 - 13:20 GMT

This hands-on tutorial will introduce you to building RESTful web services
using the new Microsoft Web APIs (http://wcf.codeplex.com). Over the course
of several exercises, we'll develop a simple Fighting Fantasy service for
machines to play when they're not busy running your business applications.
The tutorial's mixture of theory and practice will cover:
- Resource design and development
- Test-driven server- and client-side development
- The Atom Syndication Format
- Caching
- Hypermedia

http://skillsmatter.com/podcast/open-source-dot-net/restful-web-service-development-in-dot-net

*BAY AREA Meetup: Spring Data  Neo4j*
Wednesday, 7 September @ 19:00 PDT

Join us for an introduction to Spring Data, with a special emphasis on
Spring Data Neo4j. We'll get you started with this exciting new technology,
then take a deeper dive into how you can make the magic happen with Neo4j.

www.meetup.com/graphdb/events/30126321/

*WEBINAR: Getting Started with Spring Data Graph*
Thursday, 8 September @ 10:00-11:00 PDT

The Spring Data project makes it easier to build Spring-powered applications
that use new data access technologies such as non-relational NOSQL
databases, cloud based data services, and graph databases.

This webinar is designed for enterprise developers who are working with
Spring and need to understand if they can benefit from a graph database. The
session will introduce the different types of data management offered in
Spring Data, including graph databases, and will show how easy it is to get
started with the Spring Data Graph project.

https://www1.gotomeeting.com/register/622766136

*São Paulo Workshop: A Programmatic Introduction to Neo4j *@ QCon 2011
Saturday, 10 September @ 9:00 - 17:00 BRT

This tutorial covers the core functionality from the Neo4j graph database,
providing a mixture of theory and accompanying practical sessions to
demonstrate the capabilities of graph data and the Neo4j database.

http://qconsp.com/workshop

*São Paulo Presentation: by Adriano Almeida @ QCon 2011 *
Saturday, 10 September @ 13:00 BRT

http://www.qconsp.com/palestrante/adriano-almeida

*Allison Sparrow* *
**Marketing Manager | Neo Technology*
+19499036091 | @ayeeson http://twitter.com/#%21/ayeeson

***
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] [Spring Data Graph] Some questions/suggestions about cross-store persistence

2011-09-06 Thread Michael Hunger
Hi Michel,

sorry just returned from vacation.

the problem with 1) is still - you have to start to define fetch-groups for 
subgraphs etc and you also have to define cascading rules for updates of 
relationships.

Right now I don't have the resources to add all these things (especially as the 
devil lies in the details).

As I already said it is preferable anyway to use attached entities within 
transactional contexts. The detached state was mainly added as convenience for 
web-ui handling.

I see the one issue that you pointed out regarding updates to detached 
entities by other users of the graphdb which then show up due to read-through.

Regarding your notion of domain objects - that always depends on your 
architecture.

I'll incorporate your suggestions in our planning but can't promise anything 
about schedules.

2) why is persist confusing?
3) you mean when you persist() a entity to the JPA store then the graph store 
should be persisted as well? It the entity was retrieved in a tx, all its 
changes should be written to the graph store anyway without an explicit 
persist. 
4) We'll put some effort in the cross-store part of Spring Data Graph, but that 
will be probably rather to the end of the year.

Cheers

Michael


Am 06.09.2011 um 23:11 schrieb Michel Domenjoud:

 Hello!
 Is  there anybody to answer to my previous email?
 
 Thanks!
 Michel
 
 2011/9/2 Michel Domenjoud mdomenj...@octo.com
 
 Hi,
 I'm currently testing Spring Data Graph, with a focus on polyglot
 persistence use cases, in order to give a short presentation at Spring User
 Group in Paris on September.
 This email follows my previous discussion with Michael Hunger (pasted
 below), and I have some questions/suggestions:
 
 1- Add a real detached state for entities:
 In my previous discussion, I was a bit worrying about the behaviour of Node
 Entities which make all getters calls doing a read through in the graph
 database, even if we are not in a transaction.
 If I understood it correctly, there is indeed no real detached state for
 node entities.
 I think this is really an issue because it doesn't correspond to the domain
 centric purpose of Spring Data. IMHO, this is a semantic problem: if my
 NodeEntities are domain objects, I expect that a getter call is immutable,
 and so that it is not a read from database operation (at least once I'm out
 of a transaction).
 
 = Imagine I have a big process, for example a computation engine using
 nodes entities retrieved from the graph, with long computation, and output
 to a file, or another storage engine:
 -With the current behaviour, the only way to be sure that all properties of
 a Node Entity are immutable when doing some processes is either to keep a
 transaction opened during the whole process, either using clones for all
 nodes.
 - Keeping a very long transaction, knowing I may use many nodes is IMHO
 definitly a bad idea.
 - I can clone my entities, but I think this is not a good idea too, as I
 will use exactly the same class without any backing Node.
 = This matter can be really more confusing when using cross-store
 persistence, as JPA entities have real detached state.
 To answer to Michael, I don't think this must always goes with complicated
 Fetch strategies : you could implement a Lazy loading, which would only
 retrieve node properties by default, then the developper would need to
 retrieve relationships and related Nodes using an explicit call.
 
 2. persist() operation is a bit confusing and could lead to mistakes: I'd
 suggest to separate it in two methods, save and merge.
 
 3. Cross-store persistence: Allow explicit re-attaching JPA side operation.
 
 Currently, when retrieving a partial NodeEntity from graph database, its
 JPA is automatically retrieved. On the other side, when retrieving an entity
 from relationnal database, I have to make an explicit call to persist() to
 merge the graph side.
 = I think this can lead to errors, and performances leaks, by example:
 I use a Traversal to retrieve some partial entities in order to update
 them, but only for graph side properties. This will work, but for each
 retrieved entity a implicit JPA merge call will be done...
 
 4- Last question: what are the forecasts about Cross-store persistence API
 in Spring Data Graph? Are you planning to make some enhancements on it, or
 is it just some sugar over Spring Data Graph API?
 
 Thanks by advance for your answers!
 Michel
 
 Hi Michael,
 Ok, I get your point now. In fact, the thing I didn't understand yet was
 that each get call on an entity can be compared as a SELECT on relational
 db, even no explicit call to the graph repository is done.
 
 So, if I understand well, I'd improve the documentation by adding somthing
 like that after the paragraph
 Existing  All entities returned by library functions are initially in an
 attached state. Just as with any other entity, changing them outside of a
 transaction detaches them, and they must be reattached with persist() for
 the 

[Neo4j] Index entry removal after relationship deletion

2011-09-06 Thread Nuo Yan
Hey guys,

When a relationship gets deleted, will it be removed from the index
automatically? My test shows yes, but I want to be absolutely certain.

For example, a relationship :foo exists between node A and B and it's
indexed on the foo_rels index with key node_a's id and value node_b's id.
When I delete this relationship, do I also have to manually remove it from
the index (i.e. a DELETE to /index/relationship/foo_rels/15/23/100 where 15
is the key, 23 is the value, 100 is the relationship id)?
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] how Neo4j work for sorting chinese character?

2011-09-06 Thread iamyuanlong
A ha ! I changed the cypher Scala source code by myself .  Thank you for your
help.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-how-Neo4j-work-for-sorting-chinese-character-tp3309754p3315369.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


Re: [Neo4j] Index entry removal after relationship deletion

2011-09-06 Thread Linan Wang
as far as i know, no. you need to do it yourself.
hint: http://docs.neo4j.org/chunked/1.4.1/indexing-update.html

On Wed, Sep 7, 2011 at 1:25 AM, Nuo Yan yan@gmail.com wrote:
 Hey guys,

 When a relationship gets deleted, will it be removed from the index
 automatically? My test shows yes, but I want to be absolutely certain.

 For example, a relationship :foo exists between node A and B and it's
 indexed on the foo_rels index with key node_a's id and value node_b's id.
 When I delete this relationship, do I also have to manually remove it from
 the index (i.e. a DELETE to /index/relationship/foo_rels/15/23/100 where 15
 is the key, 23 is the value, 100 is the relationship id)?
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Best regards

Linan Wang
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] multiple lucene index in a transaction doesn't work?!

2011-09-06 Thread nhatvo
I've searched around the forum, and aware of people who are using different
indexes for optimization.  I am trying modify the
EmbeddedNeo4jWithIndexing.java from the samples directory so support
multiple indexes and I kept on getting exception whenever I try to commit
the transaction.  My use case seems so obvious so there must be a solution
for this.  If I only have one of the indexes, then it's fine, but whenever I
have 2 indexes then it barf'ed! 

The scenario I have is one node with a name and a description.  I want the
description to have full text search, but not the name.  So here is the
standard setup code (simplified for illustration).

g = new EmbeddedGraphDatabase(storeDir);
nIndex = g.index().forNodes (node_name);
dIndex = g.index().forNodes (node_desc,
MapUtil.stringMap(IndexManager.PROVIDER, lucene, type, fulltext));

try{
tx = graphDatabaseService.beginTx();

node = g.createNode();
node.setProperty(name,hello);
node.setProperty(description,this is the description);

nIndex.add(node, name,hello);
dIndex.add(node, description,this is the description);

tx.success();
}finally{
tx.finish();
}



Here is the exception I got:

Sep 6, 2011 8:53:32 PM org.neo4j.kernel.impl.transaction.TxManager commit
SEVERE: Commit failed
java.nio.channels.OverlappingFileLockException
at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
at
sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
at
org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:216)
at org.apache.lucene.store.Lock.obtain(Lock.java:72)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1097)
at
org.neo4j.index.impl.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:588)
at
org.neo4j.index.impl.lucene.CommitContext.ensureWriterInstantiated(CommitContext.java:59)
at
org.neo4j.index.impl.lucene.LuceneCommand$AddCommand.perform(LuceneCommand.java:188)
at
org.neo4j.index.impl.lucene.LuceneTransaction.doCommit(LuceneTransaction.java:259)
at
org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.commit(XaTransaction.java:319)
at
org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:456)
at
org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
at
org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:516)
at 
org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:659)
at 
org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:622)
at
org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:107)
at 
org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:85)
EmbeddedNeo4jWithIndexing.main(EmbeddedNeo4jWithIndexing.java:85)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Sep 6, 2011 8:53:32 PM org.neo4j.kernel.impl.transaction.TxManager commit
SEVERE: Unable to rollback transaction. Some resources may be commited
others not. Neo4j kernel should be SHUTDOWN for resource maintance and
transaction recovery 
javax.transaction.xa.XAException: Unknown
xid[GlobalId[NEOKERNL|-1963523328321029165|2], BranchId[ 52 49 52 49 52 49
]]
at
org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.rollback(XaResourceManager.java:481)
at
org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.rollback(XaResourceHelpImpl.java:111)
at
org.neo4j.kernel.impl.transaction.TransactionImpl.doRollback(TransactionImpl.java:533)
at 
org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:685)
at 
org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:622)
at
org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:107)
at 
org.neo4j.kernel.TopLevelTransaction.finish(TopLevelTransaction.java:85)
EmbeddedNeo4jWithIndexing.main(EmbeddedNeo4jWithIndexing.java:85)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Exception in thread main 

Re: [Neo4j] Index entry removal after relationship deletion

2011-09-06 Thread Nuo Yan
Thanks. That was what I imagined too. However, I have a test that does:

1. create two nodes (e.g. node 2 and node 3)
2. create a relationship between the two nodes (e.g. rel id 23, type :foo)
3. add the relationship to the foo_rels index, with 2 as the key, 3 as the 
value (the node ids) on rel id 23.
(In REST it's a POST to /index/relationship/foo_rels/2/3 with the URI of the 
relationship 23 as the body)
4. look up the relationship from the index, returned expected result (GET to 
/index/relationship/foo_rels/2/3).
5. delete the relationship (id 23) (a DELETE to /relationship/23)
6. look up the relationship from the index again (GET to 
/index/relationship/foo_rels/2/3), returned empty results ([]).

The result of the test confused me. It appears that the relationship was also 
removed from the index (as step 6 returned empty array) when it was deleted.

Any insights?




On Sep 6, 2011, at 7:05 PM, Linan Wang wrote:

 as far as i know, no. you need to do it yourself.
 hint: http://docs.neo4j.org/chunked/1.4.1/indexing-update.html
 
 On Wed, Sep 7, 2011 at 1:25 AM, Nuo Yan yan@gmail.com wrote:
 Hey guys,
 
 When a relationship gets deleted, will it be removed from the index
 automatically? My test shows yes, but I want to be absolutely certain.
 
 For example, a relationship :foo exists between node A and B and it's
 indexed on the foo_rels index with key node_a's id and value node_b's id.
 When I delete this relationship, do I also have to manually remove it from
 the index (i.e. a DELETE to /index/relationship/foo_rels/15/23/100 where 15
 is the key, 23 is the value, 100 is the relationship id)?
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 
 -- 
 Best regards
 
 Linan Wang
 ___
 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