[Neo4j] Node uniqueness

2011-09-02 Thread Christian Straight
What's best practices for assuring nodes are unique in a graph and in an index? 
 No problem using an if stmt & checking for pre-existence...but is there a 
better way?

Christian

.:. Typed with thumbs and sent from my HTC Evo

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


Re: [Neo4j] REST "at_depth"?

2011-09-02 Thread Alex
I need some basic help. The first call works fine, the second one results is
no result at all. What am I doing wrong?

(1) 

curl -H Accept:application/json -H Content-Type:application/json -X POST
http://localhost:7474/db/data/node/2/paths -d
'{"to":"http://localhost:7474/db/data/node/5","relationships":{"type":"KNOWS"},"algorithm":"shortestPath","max_depth":
5}'

[ {
  "start" : "http://localhost:7474/db/data/node/2";,
  "nodes" : [ "http://localhost:7474/db/data/node/2";,
"http://localhost:7474/db/data/node/3";,
"http://localhost:7474/db/data/node/4";,
"http://localhost:7474/db/data/node/5"; ],
  "length" : 3,
  "relationships" : [ "http://localhost:7474/db/data/relationship/0";,
"http://localhost:7474/db/data/relationship/1";,
"http://localhost:7474/db/data/relationship/2"; ],
  "end" : "http://localhost:7474/db/data/node/5";

So far, so good.

(2)

curl -H Accept:application/json -H Content-Type:application/json -X POST
http://localhost:7474/db/data/node/2/paths -d
'{"to":"http://localhost:7474/db/data/node/5","relationships":{"type":"KNOWS"},"algorithm":"shortestPath","prune_evaluator":
{"language":"javascript","body":"position.length() > 0;"}}'

Nothing is returned.

Adding a max_depth makes the call work again, but the prune_evaluator is
simply ignored. What am I missing?

Thanks!
Alex


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/REST-at-depth-tp3304387p3305738.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] REST "at_depth"?

2011-09-02 Thread Alex
Great! Thanks, Peter

Alex


Alex,
Evaluator.atDepth is really just a convenience method, you can always use
the full Javascript notation for the return_filter, see
http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-using-a-return-filterand
thus do "position.length==3" for the query, since the position is a
Path
object, see
http://components.neo4j.org/neo4j/1.5.M01/apidocs/org/neo4j/graphdb/Path.html.

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.




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/REST-at-depth-tp3304387p3305661.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] Size on disk, and number of properties

2011-09-02 Thread Aseem Kishore
Thanks for the insights Johan!

Regarding the existing disk space then, by far the bulk of it is from the
logs. Is there a way to prune or garbage collect them? Is simply deleting
the files safe? Should the db be off if I do that? Etc.

Thanks much!

Aseem

On Tue, Aug 30, 2011 at 2:47 AM, Johan Svensson wrote:

> Hi Aseem,
>
> This is actually expected behavior when performing file copy of
> running db and starting up with default configuration. If you remove
> the files ending with .id in the db directory on the local snapshot
> and start up setting "rebuild_idgenerators_fast=false" you should see
> the accurate amount of nodes, relationships and properties.
>
> Regarding the amount of properties not matching this could be due to a
> non clean shutdown on the production system. We are planing on
> improving this in the near future by allowing for more aggressive
> reuse of ids for properties. This will specifically improve things for
> workloads that perform a lot of property updates.
>
> -Johan
>
> On Tue, Aug 30, 2011 at 10:05 AM, Aseem Kishore 
> wrote:
> > Hey guys,
> >
> > We do offline backups of our db on a semi-regular basis (every few days),
> > where we (1) stop the running db, (2) copy its data directory and (3)
> > restart the db.
> >
> > A few times early on, we did running backups -- but not the proper
> "online"
> > way -- where we simply copied the data directory while the db was still
> > running. (We did this during times where we were confident no requests
> were
> > hitting the db.)
> >
> > We noticed that every time we did the running backup, the number of
> > properties the web admin reported -- and the space on disk of the db --
> > would jump up quite a bit. We stopped doing that recently.
> >
> > But even now, both these numbers have gotten quite a bit higher than we
> > expect to, and strangely, they seem to differ highly between the running
> db
> > and the copies.
> >
> > What could be causing all of this?
> >
> > Here are our current numbers:
> >
> > *Production*
> > - 2,338 nodes
> > - 4,473 rels
> > - 114,231 props (higher than we would expect it to be, but not by an
> order
> > of magnitude)
> > - *1.39 GB!* <-- this is way unexpected, particularly since our db used
> to
> > be in the ~10 KB ballpark, and we certainly haven't experienced hockey
> stick
> > growth yet ;) The logical log only takes up 57 KB (0%) btw.
> >
> >
> > *Local snapshot*
> > - 2,338 nodes
> > - 4,473 rels
> > - *2,607,892 props!!!* <-- ???
> > - *1.37 GB!* <-- equally surprisingly high, but also interesting that
> it's
> > less than the production db's size. 0 KB logical logs.
> >
> >
> > I looked around the wiki and searched this mailing list but didn't find
> much
> > clues here. But as requested on another thread, here's the output of `ls
> -lh
> > data/graph.db/`:
> >
> > total 1474520
> > -rw-r--r--   1 aseemk  staff11B Aug 30 00:46 active_tx_log
> > drwxr-xr-x  52 aseemk  staff   1.7K Aug 30 00:46 index/
> > -rw-r--r--   1 aseemk  staff   343B Aug 30 00:46 index.db
> > -rw-r--r--   1 aseemk  staff   854K Aug 30 00:46 messages.log
> > -rw-r--r--   1 aseemk  staff36B Aug 30 00:46 neostore
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46 neostore.id
> > -rw-r--r--   1 aseemk  staff26K Aug 30 00:46 neostore.nodestore.db
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> neostore.nodestore.db.id
> > -rw-r--r--   1 aseemk  staff62M Aug 30 00:46
> neostore.propertystore.db
> > -rw-r--r--   1 aseemk  staff   133B Aug 30 00:46
> > neostore.propertystore.db.arrays
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.propertystore.db.arrays.id
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.propertystore.db.id
> > -rw-r--r--   1 aseemk  staff   1.0K Aug 30 00:46
> > neostore.propertystore.db.index
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.propertystore.db.index.id
> > -rw-r--r--   1 aseemk  staff   4.0K Aug 30 00:46
> > neostore.propertystore.db.index.keys
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.propertystore.db.index.keys.id
> > -rw-r--r--   1 aseemk  staff69M Aug 30 00:46
> > neostore.propertystore.db.strings
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.propertystore.db.strings.id
> > -rw-r--r--   1 aseemk  staff   144K Aug 30 00:46
> > neostore.relationshipstore.db
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.relationshipstore.db.id
> > -rw-r--r--   1 aseemk  staff55B Aug 30 00:46
> > neostore.relationshiptypestore.db
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.relationshiptypestore.db.id
> > -rw-r--r--   1 aseemk  staff   602B Aug 30 00:46
> > neostore.relationshiptypestore.db.names
> > -rw-r--r--   1 aseemk  staff 9B Aug 30 00:46
> > neostore.relationshiptypestore.db.names.id
> > -rw-r--r--   1 aseemk  staff16B Aug 30 00:46 nioneo_logical.log.1
> > -rw-r--r--   1 aseemk  staff 4B Aug 30 00:46
> nioneo_logical.log.a

Re: [Neo4j] Some questions about design when using neo4j

2011-09-02 Thread Benjamin Gustafsson
Just in case there are any graph experts out there that want to exercise
their brains. (Its quite a while since I studied algorithms and optimization
regarding graphs. :-)

I'm able to implement a algorithm described in pseudocode (if anyone knows a
good algorithm for my special case below).

I have the transportation problem and need to find a preferably small (not
necessarily smallest) set of nodes that transports a certain amount of
credit/commodity from source node S to sink node T. All edges have a
capacity stated as a attribute for the edge, this can be read while
traversing the graph. Transportation cost for commodity/credit in the graph
is zero. The only cost in this graph problem is computation time to *find a
set of paths delivering all the commodity*(in my case credit). The path
lengths chosen are not important.

(This is the standard ripplepay problem, but I didn't like the algorithms
used by the original ripplepay implementation. It does not scale up to
millions of users. It is not fast enough.)

http://en.wikipedia.org/wiki/Transportation_network_%28graph_theory%29

And I also need a quick way of analysing if it is possible to send all
commodity across the network. If the amount commodity to be sent is lower
than max flow. (lower than min cut). There will initially be clusters with
very few edges connecting the clusters. If the nodes are in different
clusters the min cut can be really easy/*quick* to find (if we do it the
right way).

http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem

Any implementations for neo4j already available regarding my special case?

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


Re: [Neo4j] REST "at_depth"?

2011-09-02 Thread Peter Neubauer
Alex,
Evaluator.atDepth is really just a convenience method, you can always use
the full Javascript notation for the return_filter, see
http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-using-a-return-filterand
thus do "position.length==3" for the query, since the position is a
Path
object, see
http://components.neo4j.org/neo4j/1.5.M01/apidocs/org/neo4j/graphdb/Path.html.

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 Fri, Sep 2, 2011 at 4:42 PM, Alex  wrote:

> Dear Neo4Jers
>
> is there anything like "at_depth" in the REST API? I only found
> "max_depth",
> although Evaluators.atDepth(depth) exists in the Java API.
>
> Cheers
> Alex
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/REST-at-depth-tp3304387p3304387.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] 10 questions

2011-09-02 Thread Peter Neubauer
Linan,
see inline ...

On Fri, Sep 2, 2011 at 9:01 PM, Linan Wang  wrote:

> is it
> https://github.com/peterneubauer/graph-collections/wiki/Indexed-relationships
> ?
> seems not included in the current stable ver.
>
No, this is work-in-progress, we are quite strict when it come sto including
things into the official release, since we need to test and document it
better. So, feel free to test it, a lot of code in there is stable, and
expect to fork and contribute if you find things to fix!


> >> 4, what's the best practice to do bulk insertion when running (not
> >> seed initial data)? i read post says that too many insertions within a
> >> transaction may lead to memory problem? what's the proper mount of
> >> insertion within a transaction?
> >>
> > Yes, transaction data is kept in memory before calling commit and
> flushing
> > to disk, so overly large TX might result in memory problems. OTOH small
> TX
> > incur higher IO load.
> i'll probably do it with smaller batches (~1k operations per batch)
> from an external queue. does it sounds reasonable?
> >
>
Yes. From experience, there seems to be a lot of cases where transactions
hold between 1K and 10K operations and give a good performance vs. RAM vs.
persistence balance, if you can afford it for your data.


> >
> >> 5, is there a suggested max length for string/array property? would it
> >> be better to put into sql?
> >>
> > Well, the String store block size is adjustable (and we are working on
> even
> > better layouts there), but for big strings like documents, a fiel system
> or
> > Key/Value store might be better, and just keeping the reference to the
> > location makes more sense.
> ok, i'll use redis for strings.
>
> Probably a sensible choice. There might even be an Neo4j index coming out
for Redis, making it transactional with the graph like Lucene.


>  >
> > 6, say a facebook user may "likes" thousands of things, and these
> >> things are sparsly connected. in this case, things should be modeled
> >
> > as nodes or array property?
> >>
> > Nodes. Sparse connections are one of the places where Neo4j shines - a
> > fairly balanced graph where supernodes are seldom.
> >
> could you give a bottom number qualifies "supernode"? say 1k
> connections within a graph of 1m nodes?
>
> with the current store layout, probably 1K is a good number. We are working
with store changes that require less reads, but don't explicitly take care
of supernodes. The is in plan, in which case this number will change upwards
with good performance :)

> >
> >> 7, where can i find an example to use domain models with serverplugin?
> >> i want to put my data in a standalone server and just use the
> >> serverplugin, unmanaged extension. should i just put the domain models
> >> into the same serverplugin jar?
> >>
> >  Yes, I would do that. However, if you are not expecting to return Nodes,
> > Relationships or Properties, an unmanaged extension will give you the
> full
> > API of REST services. One extension that way is for instance the
> scripting
> > extension, see https://github.com/neo4j/script-extension
> thanks. seems i really should look into github instead of neo4j.org ;)
>
Well, it's hard to list everything, we are right now trying to put as much
as possible into the manual which can be generated, tested and curated, and
serve as a reference.


> >
> > Sorry for the delay, hope this helps. Let us know if you have more
> > questions!
> many thanks! i understand documentation is probably not your top
> priority at this point, but since we are all programmers, we can read
> codes. i feel samples on wiki and downloads are not updated to use the
> most recent release.
>
I think what you are seeing is the Wiki getting outdated over time. We are
in the process of moving the Wiki content into docs.neo4j.org, that one is
MUCH better up to date - all code you see in there is generated from running
tests. For real. So I think this will change soon to a point where we can
delete most of the Wiki pages. Sorry for the inconvenience!

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


Re: [Neo4j] 10 questions

2011-09-02 Thread Linan Wang
yes, it's a smart question!

On Fri, Sep 2, 2011 at 4:06 PM, Rick Otten  wrote:
> Should one make an effort to keep "node 0" from becoming a 'supernode'?
>
>
> -Original Message-
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
> Behalf Of Steven Kalemkiewicz
> Sent: Friday, September 02, 2011 10:58 AM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] 10 questions
>
> What would you consider the lower-bound to be to classify a node as a 
> supernode?  I saw that you referred to a city node with 100K relationships...
>
> -Steve
>
> On Fri, Sep 2, 2011 at 10:33 AM, Peter Neubauer < 
> peter.neuba...@neotechnology.com> wrote:
>
>> > 1, what's the general rule for choosing properties or relationship?
>> > say a User lives in a City, which just contains a simple int  id
>> > value. to find users live in a city, i can do a simple traversal, of
>> > all user nodes, or find the city node first, then collect all the
>> > users. seems to me both ways work and share same level of performance.
>> > (am i right here?)
>> >
>> Generally, if a number of properties really is denoting the same
>> concept (like a city) and you don't want to duplicate the data, and be
>> able to traverse or query it, I would introduce nodes. However, if the
>> node woudl turn into a supernode (like a city node with 100K
>> relationships), then consider introducing an in-graph indexing
>> structure, or an out-of-graph external index like Lucene in order to
>> look up relationships or nodes when you need them, since that will be 
>> cheaper.
>>
>> 6, say a facebook user may "likes" thousands of things, and these
>> > things are sparsly connected. in this case, things should be modeled
>> > as nodes or array property?
>> >
>> Nodes. Sparse connections are one of the places where Neo4j shines - a
>> fairly balanced graph where supernodes are seldom.
>>
>>
> ___
> 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
>



-- 
Best regards

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


Re: [Neo4j] 10 questions

2011-09-02 Thread Linan Wang
On Fri, Sep 2, 2011 at 3:33 PM, Peter Neubauer
 wrote:
> Hi Linan,
> trying fast stabs at answers inline before heading home :)
>
> On Thu, Sep 1, 2011 at 3:29 AM, Linan Wang  wrote:
>
>> hi,
>> got some questions not found simple answers from the documents. i bet
>> some of them are pretty primitive, bear with me  please.
>>
>> 1, what's the general rule for choosing properties or relationship?
>> say a User lives in a City, which just contains a simple int  id
>> value. to find users live in a city, i can do a simple traversal, of
>> all user nodes, or find the city node first, then collect all the
>> users. seems to me both ways work and share same level of performance.
>> (am i right here?)
>>
> Generally, if a number of properties really is denoting the same concept
> (like a city) and you don't want to duplicate the data, and be able to
> traverse or query it, I would introduce nodes. However, if the node woudl
> turn into a supernode (like a city node with 100K relationships), then
> consider introducing an in-graph indexing structure, or an out-of-graph
> external index like Lucene in order to look up relationships or nodes when
> you need them, since that will be cheaper.
>
is it 
https://github.com/peterneubauer/graph-collections/wiki/Indexed-relationships
?
seems not included in the current stable ver.
>
>> 2, does index operation add/remove/modify threadsafe, don't need
>> lock/transaction?
>>
> Yes, but the index framework is transactional as well as the graph. You need
> TX for any modifying operation, but not for reads.
>
>
>> 3, does it simple property writing operations also need to be wrapped
>> inside transaction? if so, in the imdb exmaple
>> tutor/domain/MovieImpl.java underlyingNode.setProperty is used neither
>> within transaction, nor put into a save method, do all setProperty
>> works inside a transaction?
>>
> See Anders reply and above.
Got the two. thanks!
>
>
>> 4, what's the best practice to do bulk insertion when running (not
>> seed initial data)? i read post says that too many insertions within a
>> transaction may lead to memory problem? what's the proper mount of
>> insertion within a transaction?
>>
> Yes, transaction data is kept in memory before calling commit and flushing
> to disk, so overly large TX might result in memory problems. OTOH small TX
> incur higher IO load.
i'll probably do it with smaller batches (~1k operations per batch)
from an external queue. does it sounds reasonable?
>
>
>> 5, is there a suggested max length for string/array property? would it
>> be better to put into sql?
>>
> Well, the String store block size is adjustable (and we are working on even
> better layouts there), but for big strings like documents, a fiel system or
> Key/Value store might be better, and just keeping the reference to the
> location makes more sense.
ok, i'll use redis for strings.

>
> 6, say a facebook user may "likes" thousands of things, and these
>> things are sparsly connected. in this case, things should be modeled
>
> as nodes or array property?
>>
> Nodes. Sparse connections are one of the places where Neo4j shines - a
> fairly balanced graph where supernodes are seldom.
>
could you give a bottom number qualifies "supernode"? say 1k
connections within a graph of 1m nodes?

>
>> 7, where can i find an example to use domain models with serverplugin?
>> i want to put my data in a standalone server and just use the
>> serverplugin, unmanaged extension. should i just put the domain models
>> into the same serverplugin jar?
>>
>  Yes, I would do that. However, if you are not expecting to return Nodes,
> Relationships or Properties, an unmanaged extension will give you the full
> API of REST services. One extension that way is for instance the scripting
> extension, see https://github.com/neo4j/script-extension
thanks. seems i really should look into github instead of neo4j.org ;)
>
> 8, the warning in the documentation about unmanaged extension is
>> scary. what i can see is that people may use bad ways, instead of
>> Iterator/IteratorWrappers. any comment on this?
>>
> Yeah. It's just a warning, no sudden death. With that approach, you are
> inventing your own API and can do whatever you want, for good and bad.
>
>
>> 9, i'm not sure if it's trival: find out users who are only 2
>> relationships a way (use twitter example: my followees' followers),
>> live in same city, group by age and gender. also retrieve all their
>> followees. i want to do the traversal in java, where can i find an
>> examples?
>>
> Well,
> http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-traversal.htmlshould
> get you started? Also, in the next version, the Tinkerpop fluent
> iterator API (https://github.com/tinkerpop/pipes/wiki/FluentPipeline) is
> hopefully finding its way into the Neo4j release, if QA is ok, and you will
> have more options to do this.
>
thanks, will check it out.
>
>> 10, i've had horrible experience in turning jvm options. have neo4j
>> been running on Zing

Re: [Neo4j] 10 questions

2011-09-02 Thread Marko Rodriguez
Oh, I didn't see this:

"(use twitter example: my followees' followers)"

Then the query I provided in the previous email:

g.v(1).out('livesIn').sideEffect{city = 
it}.back(2).out.out.filter{it.out('livesIn').next().equals(city)}.groupCount(age){it.age}.groupCount(gender){it.gender}

would now be:

g.v(1).out('livesIn').sideEffect{city = 
it}.back(2).in('follows').in('follows').filter{it.out('livesIn').next().equals(city)}.groupCount(age){it.age}.groupCount(gender){it.gender}

as in('follows') is someone's followees (i.e. the people that follow me).

Enjoy,
Marko.

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


Re: [Neo4j] 10 questions

2011-09-02 Thread Marko Rodriguez
Hi,

>> 9, i'm not sure if it's trival: find out users who are only 2
>> relationships a way (use twitter example: my followees' followers),
>> live in same city, group by age and gender. also retrieve all their
>> followees. i want to do the traversal in java, where can i find an
>> examples?

If you use Gremlin, then you can do your query as follows:

age = [:]
gender = [:]
people = g.v(1).out('livesIn').sideEffect{city = 
it}.back(2).out.out.filter{it.out('livesIn').next().equals(city)}.groupCount(age){it.age}.groupCount(gender){it.gender}
 >> []

NOTE: This is a Gremlin 1.2+ query (so use Neo4j 1.5M01).

The query says this:
1. create an empty hash map called age
2. create an empty hash map called gender
3. main traversal
- start from vertex 1
- determine what city vertex 1 lives in
- save that city vertex to the variable city
- go back to vertex 1 (back(2) means go back 2 steps ago)
- go down 2 relationships -- (could be both.both if you are 
doing undirected)
- filter out those vertices that do not live in the same city 
as vertex 1
- index those vertices ages into the age hash map with the 
values being the distribution of ages.
- index those vertices genders into the gender hash map with 
the values being the distribution of genders. 
- insert those vertices into an empty list and save the 
reference to people.

Thus, your results are:
people : the people that meat the traversal description
age : their ages as a distribution (count)
gender: their genders as a distribution (count)

As Peter says, you can do this in native Java (instead of Groovy) if you want 
using FluentPipeline, but that is still in SNAPSHOT over at TinkerPop and will 
not be released for about a month. 

Good luck with your project,
Marko.

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


Re: [Neo4j] 10 questions

2011-09-02 Thread Rick Otten
Should one make an effort to keep "node 0" from becoming a 'supernode'?


-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Steven Kalemkiewicz
Sent: Friday, September 02, 2011 10:58 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] 10 questions

What would you consider the lower-bound to be to classify a node as a 
supernode?  I saw that you referred to a city node with 100K relationships...

-Steve

On Fri, Sep 2, 2011 at 10:33 AM, Peter Neubauer < 
peter.neuba...@neotechnology.com> wrote:

> > 1, what's the general rule for choosing properties or relationship?
> > say a User lives in a City, which just contains a simple int  id 
> > value. to find users live in a city, i can do a simple traversal, of 
> > all user nodes, or find the city node first, then collect all the 
> > users. seems to me both ways work and share same level of performance.
> > (am i right here?)
> >
> Generally, if a number of properties really is denoting the same 
> concept (like a city) and you don't want to duplicate the data, and be 
> able to traverse or query it, I would introduce nodes. However, if the 
> node woudl turn into a supernode (like a city node with 100K 
> relationships), then consider introducing an in-graph indexing 
> structure, or an out-of-graph external index like Lucene in order to 
> look up relationships or nodes when you need them, since that will be cheaper.
>
> 6, say a facebook user may "likes" thousands of things, and these
> > things are sparsly connected. in this case, things should be modeled 
> > as nodes or array property?
> >
> Nodes. Sparse connections are one of the places where Neo4j shines - a 
> fairly balanced graph where supernodes are seldom.
>
>
___
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] 10 questions

2011-09-02 Thread Steven Kalemkiewicz
What would you consider the lower-bound to be to classify a node as a
supernode?  I saw that you referred to a city node with 100K
relationships...

-Steve

On Fri, Sep 2, 2011 at 10:33 AM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:

> > 1, what's the general rule for choosing properties or relationship?
> > say a User lives in a City, which just contains a simple int  id
> > value. to find users live in a city, i can do a simple traversal, of
> > all user nodes, or find the city node first, then collect all the
> > users. seems to me both ways work and share same level of performance.
> > (am i right here?)
> >
> Generally, if a number of properties really is denoting the same concept
> (like a city) and you don't want to duplicate the data, and be able to
> traverse or query it, I would introduce nodes. However, if the node woudl
> turn into a supernode (like a city node with 100K relationships), then
> consider introducing an in-graph indexing structure, or an out-of-graph
> external index like Lucene in order to look up relationships or nodes when
> you need them, since that will be cheaper.
>
> 6, say a facebook user may "likes" thousands of things, and these
> > things are sparsly connected. in this case, things should be modeled
> > as nodes or array property?
> >
> Nodes. Sparse connections are one of the places where Neo4j shines - a
> fairly balanced graph where supernodes are seldom.
>
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] REST "at_depth"?

2011-09-02 Thread Alex
Dear Neo4Jers

is there anything like "at_depth" in the REST API? I only found "max_depth",
although Evaluators.atDepth(depth) exists in the Java API.

Cheers
Alex

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/REST-at-depth-tp3304387p3304387.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] 10 questions

2011-09-02 Thread Peter Neubauer
Hi Linan,
trying fast stabs at answers inline before heading home :)

On Thu, Sep 1, 2011 at 3:29 AM, Linan Wang  wrote:

> hi,
> got some questions not found simple answers from the documents. i bet
> some of them are pretty primitive, bear with me  please.
>
> 1, what's the general rule for choosing properties or relationship?
> say a User lives in a City, which just contains a simple int  id
> value. to find users live in a city, i can do a simple traversal, of
> all user nodes, or find the city node first, then collect all the
> users. seems to me both ways work and share same level of performance.
> (am i right here?)
>
Generally, if a number of properties really is denoting the same concept
(like a city) and you don't want to duplicate the data, and be able to
traverse or query it, I would introduce nodes. However, if the node woudl
turn into a supernode (like a city node with 100K relationships), then
consider introducing an in-graph indexing structure, or an out-of-graph
external index like Lucene in order to look up relationships or nodes when
you need them, since that will be cheaper.


> 2, does index operation add/remove/modify threadsafe, don't need
> lock/transaction?
>
Yes, but the index framework is transactional as well as the graph. You need
TX for any modifying operation, but not for reads.


> 3, does it simple property writing operations also need to be wrapped
> inside transaction? if so, in the imdb exmaple
> tutor/domain/MovieImpl.java underlyingNode.setProperty is used neither
> within transaction, nor put into a save method, do all setProperty
> works inside a transaction?
>
See Anders reply and above.


> 4, what's the best practice to do bulk insertion when running (not
> seed initial data)? i read post says that too many insertions within a
> transaction may lead to memory problem? what's the proper mount of
> insertion within a transaction?
>
Yes, transaction data is kept in memory before calling commit and flushing
to disk, so overly large TX might result in memory problems. OTOH small TX
incur higher IO load.


> 5, is there a suggested max length for string/array property? would it
> be better to put into sql?
>
Well, the String store block size is adjustable (and we are working on even
better layouts there), but for big strings like documents, a fiel system or
Key/Value store might be better, and just keeping the reference to the
location makes more sense.

6, say a facebook user may "likes" thousands of things, and these
> things are sparsly connected. in this case, things should be modeled

as nodes or array property?
>
Nodes. Sparse connections are one of the places where Neo4j shines - a
fairly balanced graph where supernodes are seldom.


> 7, where can i find an example to use domain models with serverplugin?
> i want to put my data in a standalone server and just use the
> serverplugin, unmanaged extension. should i just put the domain models
> into the same serverplugin jar?
>
 Yes, I would do that. However, if you are not expecting to return Nodes,
Relationships or Properties, an unmanaged extension will give you the full
API of REST services. One extension that way is for instance the scripting
extension, see https://github.com/neo4j/script-extension

8, the warning in the documentation about unmanaged extension is
> scary. what i can see is that people may use bad ways, instead of
> Iterator/IteratorWrappers. any comment on this?
>
Yeah. It's just a warning, no sudden death. With that approach, you are
inventing your own API and can do whatever you want, for good and bad.


> 9, i'm not sure if it's trival: find out users who are only 2
> relationships a way (use twitter example: my followees' followers),
> live in same city, group by age and gender. also retrieve all their
> followees. i want to do the traversal in java, where can i find an
> examples?
>
Well,
http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-traversal.htmlshould
get you started? Also, in the next version, the Tinkerpop fluent
iterator API (https://github.com/tinkerpop/pipes/wiki/FluentPipeline) is
hopefully finding its way into the Neo4j release, if QA is ok, and you will
have more options to do this.


> 10, i've had horrible experience in turning jvm options. have neo4j
> been running on Zing JVM, hp nonstop jvm? are they better options?
>
> I think there are initial tests running on Zing, but I don't know for sure.
If you have access to such a machine, ir would be great if you can give
feedback. Michael Hunger is doing a lot of these tests for hosting.


Sorry for the delay, hope this helps. Let us know if you have more
questions!

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


Re: [Neo4j] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Marko Rodriguez
Hi,

My thoughts on the matter.

Frames is bare-bones simple and the library is tiny. If you simply want to do 
the following, then Frames is cool:
1. Use annotated interfaces to define a Graph-to-Object mapping. (at 
the cost of Java reflection)
2. Use your objects as a way to "schemify" (constrain) your graph.
3. Put and get objects out of your graph and abandon the "vertex/edge" 
mental model. You can simply think in terms of Java objects.
- this is optional as I tend to use Frames only for data ingest.
4. (NEXT RELEASE) use Pipes or Gremlin to define 
abstract/inferred/virtual relationships between your domain objects.

Frames does not fit into a larger framework (outside of TinkerPop). 
Unfortunately, I don't know Spring, but from what I can tell, its a heavily 
used ?web application? framework and has lots of bells and whistles so it will 
definitely be more feature rich.

As Alfredas Chmeiliauskas (wow thats a crazy last name) says, there are lots of 
ways to mix and match things so don't feel that you will be trapped by a 
technology. Its easy to move between raw Neo4j/Blueprints, Cypher/Gremlin, etc. 
The only big choice I believe you make is whether you go Neo4j Server or 
Rexster as you can't really "mix and match" those two. In many of my projects I 
use Neo4j Server with parsers written in Frames and custom extensions using 
Gremlin. I also, in another, use Rexster with a Neo4j batch inserter (no 
Frames) and only the Neo4j algos package. Sorta depends on what the project 
demands...

HTH,
Marko.

http://markorodriguez.com

On Sep 2, 2011, at 3:33 AM, Michel Domenjoud wrote:

> Thanks for your answers!
> 
> @Anders: Thanks, I noticed it, but I was more precisely wondering about
> Frames API, which brings similar functionalities to Spring Data.
> 
> 2011/9/2 Anders Nawroth 
> 
>> Note that Gremlin is supported by Spring Data Graph, it's mentioned
>> here: http://www.springsource.org/node/3208
>> 
>> /anders
>> 
>> 2011-09-02 11:05, Peter Neubauer skrev:
>>> Michel,
>>> IMHO the Spring Data Graph is a much broader approach to the problem,
>>> although it brings with it more dependencies. I guess it is a matter of
>>> choice. I would go for Spring Data Graph personally.
>>> 
>>> 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 Fri, Sep 2, 2011 at 10:38 AM, Michel Domenjoud>> wrote:
>>> 
 Hi everybody,
 
 What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
 frameworks, now there is Spring Data Graph framework?
 
 I saw that Neo4J guys are working on both projects, so do you have any
 preference for using one framework rather than the other?
 
 Michel.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
>>> ___
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo4j] Which version choose

2011-09-02 Thread Peter Neubauer
Hi there,
if you are not distributing the software and only using the output artifacts
(your customers not touching your system) then AGPL is totally fine. Happy
hacking!

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 Fri, Sep 2, 2011 at 3:00 PM, Gerosa  wrote:

> Hi,
>
> I'm starting a new project and I have a doubt:
> The software itself will not be sold, but it's output will be used for
> commercial purposes. Do I need to purchase Neo4j Advanced or am I allowed
> to
> keep with Neo4j Community version?
>
> Thanks in advance.
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Which-version-choose-tp3304144p3304144.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


[Neo4j] Which version choose

2011-09-02 Thread Gerosa
Hi,

I'm starting a new project and I have a doubt:
The software itself will not be sold, but it's output will be used for
commercial purposes. Do I need to purchase Neo4j Advanced or am I allowed to
keep with Neo4j Community version?

Thanks in advance.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Which-version-choose-tp3304144p3304144.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] [Announcement] Neo4j 1.5.M01 Boden Bord

2011-09-02 Thread Peter Neubauer
Hi all,
I am glad to announce the availability of our first milestone in the Neo4j
1.5 "Boden Bord" release, see

http://blog.neo4j.org/2011/09/announcing-neo4j-boden-bord-15m01-ga.html

for the blog. After a summer break in our regular release cycle, we hope to
get back into the swing of things, I will get back to you with details as
soon as we have decided on things.

This is just a very first milestone, many good things are underway and will
make it into master for the next pushes. Enjoy!

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] 10 questions

2011-09-02 Thread Linan Wang
great. i thought transaction only applies to nodes operations. seems
it also including indexing. it's handy!
other 9 questions? :)

On Fri, Sep 2, 2011 at 12:55 PM, Anders Nawroth
 wrote:
> Hi!
>
>>> Seems like the node and index modifications belong in the same
>>> transaction, to make sure any modifications to nodes are always
>>> reflected in the indexes as well. Otherwise they could get out of sync
>>> if your application crashes after the commit of the first,
>>> node-modifying transaction.
>> it seems confusing. if indexing actions wrapped inside a transaction
>> and the transaction fails, will indexing action automatically get
>> rollback? think this example:
>
> Yes, it will be rolled back - that's the point of performing multiple
> operations in the same transaction.
>
> /anders
>
>>
>> class User{
>> public void dosomething(){
>> //node actions
>> //index actions
>> }
>> }
>>
>> class Ext extends ServerPlugin{
>> public action(){
>> // get an array of users;
>> Transaction tx = graphDb.beginTx();
>> try
>> {
>>      ... // operations that work with the graph
>>      for(User u:users){
>>        u.dosomething();
>>     }
>>      tx.success();
>> }
>> finally
>> {
>>      tx.finish();
>> }
>> }
>>
>> }
>>
>>>
>>> /anders
>>>
>>>
>
>
> /anders
>
>> 4, what's the best practice to do bulk insertion when running (not
>> seed initial data)? i read post says that too many insertions within a
>> transaction may lead to memory problem? what's the proper mount of
>> insertion within a transaction?
>> 5, is there a suggested max length for string/array property? would it
>> be better to put into sql?
>> 6, say a facebook user may "likes" thousands of things, and these
>> things are sparsly connected. in this case, things should be modeled
>> as nodes or array property?
>> 7, where can i find an example to use domain models with serverplugin?
>> i want to put my data in a standalone server and just use the
>> serverplugin, unmanaged extension. should i just put the domain models
>> into the same serverplugin jar?
>> 8, the warning in the documentation about unmanaged extension is
>> scary. what i can see is that people may use bad ways, instead of
>> Iterator/IteratorWrappers. any comment on this?
>> 9, i'm not sure if it's trival: find out users who are only 2
>> relationships a way (use twitter example: my followees' followers),
>> live in same city, group by age and gender. also retrieve all their
>> followees. i want to do the traversal in java, where can i find an
>> examples?
>> 10, i've had horrible experience in turning jvm options. have neo4j
>> been running on Zing JVM, hp nonstop jvm? are they better options?
>>
>> thanks in advance
>>
>>
>> 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
>



>>> ___
>>> 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
>



-- 
Best regards

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


Re: [Neo4j] 10 questions

2011-09-02 Thread Anders Nawroth
Hi!

>> Seems like the node and index modifications belong in the same
>> transaction, to make sure any modifications to nodes are always
>> reflected in the indexes as well. Otherwise they could get out of sync
>> if your application crashes after the commit of the first,
>> node-modifying transaction.
> it seems confusing. if indexing actions wrapped inside a transaction
> and the transaction fails, will indexing action automatically get
> rollback? think this example:

Yes, it will be rolled back - that's the point of performing multiple 
operations in the same transaction.

/anders

>
> class User{
> public void dosomething(){
> //node actions
> //index actions
> }
> }
>
> class Ext extends ServerPlugin{
> public action(){
> // get an array of users;
> Transaction tx = graphDb.beginTx();
> try
> {
>  ... // operations that work with the graph
>  for(User u:users){
>u.dosomething();
> }
>  tx.success();
> }
> finally
> {
>  tx.finish();
> }
> }
>
> }
>
>>
>> /anders
>>
>>


 /anders

> 4, what's the best practice to do bulk insertion when running (not
> seed initial data)? i read post says that too many insertions within a
> transaction may lead to memory problem? what's the proper mount of
> insertion within a transaction?
> 5, is there a suggested max length for string/array property? would it
> be better to put into sql?
> 6, say a facebook user may "likes" thousands of things, and these
> things are sparsly connected. in this case, things should be modeled
> as nodes or array property?
> 7, where can i find an example to use domain models with serverplugin?
> i want to put my data in a standalone server and just use the
> serverplugin, unmanaged extension. should i just put the domain models
> into the same serverplugin jar?
> 8, the warning in the documentation about unmanaged extension is
> scary. what i can see is that people may use bad ways, instead of
> Iterator/IteratorWrappers. any comment on this?
> 9, i'm not sure if it's trival: find out users who are only 2
> relationships a way (use twitter example: my followees' followers),
> live in same city, group by age and gender. also retrieve all their
> followees. i want to do the traversal in java, where can i find an
> examples?
> 10, i've had horrible experience in turning jvm options. have neo4j
> been running on Zing JVM, hp nonstop jvm? are they better options?
>
> thanks in advance
>
>
> 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

>>>
>>>
>>>
>> ___
>> 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] REST batch completes with error code

2011-09-02 Thread Jacob Hansson
Damn, this is a really good catch. I think it should be rather simple to
wait with committing the transaction until the full response is generated.

I'll look into it.

In general, and as has been mentioned several times before, we obviously
need to look at how we could stream the batch operations, rather than
keeping it all in memory..

/Jake

On Fri, Sep 2, 2011 at 5:39 AM, jadell  wrote:

> I'm sending a batch REST request, with 15000 operations (1 create
> nodes,
> and 5000 create relationships between those nodes.)  In webadmin, I can see
> all the nodes and relationships have been created, and I can browse them
> using the data browser.  So the all my entities were successfully created.
> But the HTTP response is a "500 Java heap space" error.  It looks from the
> stack trace in the log like the failure occurred when mapping the results
> into the HTTP response.  This could be a pretty nasty surprise for someone
> who thinks their batch failed when all the entities were actually created.
>
> Is there anyway to not commit the transaction on the server until the
> response is generated and sent successfully?
>
> Here is the stack trace from the log:
>
>
>
> Sep 1, 2011 11:30:01 PM com.sun.jersey.spi.container.ContainerResponse
> mapMappableContainerException
> SEVERE: The exception contained within MappableContainerException could not
> be mapped to a response, re-throwing to the HTTP container
> java.lang.OutOfMemoryError: Java heap space
>at java.util.Arrays.copyOf(Arrays.java:2882)
>at
>
> java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
>at
> java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
>at java.lang.StringBuffer.append(StringBuffer.java:219)
>at org.apache.commons.lang.StringUtils.join(StringUtils.java:3088)
>at org.apache.commons.lang.StringUtils.join(StringUtils.java:3133)
>at
>
> org.neo4j.server.rest.repr.BatchOperationResults.toJSON(BatchOperationResults.java:99)
>at
>
> org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:88)
>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.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:184)
>at
>
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
>at
>
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:276)
>at
>
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)
>at
>
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
>at
>
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71)
>at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1171)
>at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1103)
>at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1053)
>at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1043)
>at
>
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:406)
>at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:477)
>at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:662)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
>at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>at
>
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> Sep 1, 2011 11:30:01 PM org.mortbay.log.Slf4jLog warn
> SEVERE: /db/data/batch
> java.lang.OutOfMemoryError: Java heap space
>at java.util.Arrays.copyOf(Arrays.java:2882)
>at
>
> java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
>at
> java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
>at java.lang.StringBuff

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

2011-09-02 Thread Michel Domenjoud
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 data to be saved.
> Add this after > However, all entities are still attached when reading
> fields, as all gettters will read through the last data in the graph. For
> people used to develop with relationnal databases, this must be  undestood
> as each getter call can be assimiled to a SELECT operation.
>
> Finally, I understand your point about read-through vs. fetch strategies
> issues, but this only means that developpers will have to code this glu by
> themselves on each application. I think that if SDG is intended to become a
> reference for using graph database, this kind of API will have to come with
> it one day (but maybe am I misleading because I'm too used to relationnal
> DB).
>
> Moreover, I see one point that could be really confusing with this approach
> in SDG : cross-store persistence. With this API, you provided the capability
> to manage JPA entities, which can use various fetch strategies, and Graph
> entities which use read through, in the same entity class.
> This point is not mentionned is the documentation, I think you should add a
> big warning about this. Something like:
> > As mentionned on Chapter 18.8 Detached node entities, node entities are
> using read-through. On the other side, JPA entities can use various fetch
> strategies. This point must be considered with caution when developping
> applications.
>
> HTH, and more questions will certainly come about cross-store persistence!
> :)
>
> Michel
>
> - Masquer le text

Re: [Neo4j] 10 questions

2011-09-02 Thread Linan Wang
hi

On Fri, Sep 2, 2011 at 10:18 AM, Anders Nawroth
 wrote:
> Hi!
>
>>> All modifying operations need to be performed inside a transaction. In
>>> most cases it makes sense to perform multiple operations in a single
>>> transaction. For example in a web application it may be a good fit to
>>> wrap the handling of one request in a transaction. So if a method
>>> doesn't start a transaction, it just means that it's handled at a higher
>>> level in the application.
>> got this part. then do you suggest to leave indexing action outside of
>> node operation? say i have a domain model and it handles indexing
>> actions along with underlying nodes modification, then in an web app,
>> should I wrap only nodes operations inside transaction and do indexing
>> only after it success?
>
> Seems like the node and index modifications belong in the same
> transaction, to make sure any modifications to nodes are always
> reflected in the indexes as well. Otherwise they could get out of sync
> if your application crashes after the commit of the first,
> node-modifying transaction.
it seems confusing. if indexing actions wrapped inside a transaction
and the transaction fails, will indexing action automatically get
rollback? think this example:

class User{
public void dosomething(){
//node actions
//index actions
}
}

class Ext extends ServerPlugin{
public action(){
// get an array of users;
Transaction tx = graphDb.beginTx();
try
{
... // operations that work with the graph
for(User u:users){
  u.dosomething();
   }
tx.success();
}
finally
{
tx.finish();
}
}

}

>
> /anders
>
>
>>>
>>>
>>> /anders
>>>
 4, what's the best practice to do bulk insertion when running (not
 seed initial data)? i read post says that too many insertions within a
 transaction may lead to memory problem? what's the proper mount of
 insertion within a transaction?
 5, is there a suggested max length for string/array property? would it
 be better to put into sql?
 6, say a facebook user may "likes" thousands of things, and these
 things are sparsly connected. in this case, things should be modeled
 as nodes or array property?
 7, where can i find an example to use domain models with serverplugin?
 i want to put my data in a standalone server and just use the
 serverplugin, unmanaged extension. should i just put the domain models
 into the same serverplugin jar?
 8, the warning in the documentation about unmanaged extension is
 scary. what i can see is that people may use bad ways, instead of
 Iterator/IteratorWrappers. any comment on this?
 9, i'm not sure if it's trival: find out users who are only 2
 relationships a way (use twitter example: my followees' followers),
 live in same city, group by age and gender. also retrieve all their
 followees. i want to do the traversal in java, where can i find an
 examples?
 10, i've had horrible experience in turning jvm options. have neo4j
 been running on Zing JVM, hp nonstop jvm? are they better options?

 thanks in advance


 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
>>>
>>
>>
>>
> ___
> 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


Re: [Neo4j] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Michel Domenjoud
Thanks for your answers!

@Anders: Thanks, I noticed it, but I was more precisely wondering about
Frames API, which brings similar functionalities to Spring Data.

2011/9/2 Anders Nawroth 

> Note that Gremlin is supported by Spring Data Graph, it's mentioned
> here: http://www.springsource.org/node/3208
>
> /anders
>
> 2011-09-02 11:05, Peter Neubauer skrev:
> > Michel,
> > IMHO the Spring Data Graph is a much broader approach to the problem,
> > although it brings with it more dependencies. I guess it is a matter of
> > choice. I would go for Spring Data Graph personally.
> >
> > 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 Fri, Sep 2, 2011 at 10:38 AM, Michel Domenjoud >wrote:
> >
> >> Hi everybody,
> >>
> >> What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
> >> frameworks, now there is Spring Data Graph framework?
> >>
> >> I saw that Neo4J guys are working on both projects, so do you have any
> >> preference for using one framework rather than the other?
> >>
> >> Michel.
> >> ___
> >> Neo4j mailing list
> >> User@lists.neo4j.org
> >> https://lists.neo4j.org/mailman/listinfo/user
> >>
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Alfredas Chmieliauskas
Call me crazy but we use a mix of SDG, blueprints, gremlin in one
project. I think that is one of the strengths of neo4j (or a graph db)
- many ways to skin a cat.

Alfredas



On Fri, Sep 2, 2011 at 11:25 AM, Anders Nawroth
 wrote:
> Note that Gremlin is supported by Spring Data Graph, it's mentioned
> here: http://www.springsource.org/node/3208
>
> /anders
>
> 2011-09-02 11:05, Peter Neubauer skrev:
>> Michel,
>> IMHO the Spring Data Graph is a much broader approach to the problem,
>> although it brings with it more dependencies. I guess it is a matter of
>> choice. I would go for Spring Data Graph personally.
>>
>> 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 Fri, Sep 2, 2011 at 10:38 AM, Michel Domenjoudwrote:
>>
>>> Hi everybody,
>>>
>>> What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
>>> frameworks, now there is Spring Data Graph framework?
>>>
>>> I saw that Neo4J guys are working on both projects, so do you have any
>>> preference for using one framework rather than the other?
>>>
>>> Michel.
>>> ___
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Anders Nawroth
Note that Gremlin is supported by Spring Data Graph, it's mentioned 
here: http://www.springsource.org/node/3208

/anders

2011-09-02 11:05, Peter Neubauer skrev:
> Michel,
> IMHO the Spring Data Graph is a much broader approach to the problem,
> although it brings with it more dependencies. I guess it is a matter of
> choice. I would go for Spring Data Graph personally.
>
> 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 Fri, Sep 2, 2011 at 10:38 AM, Michel Domenjoudwrote:
>
>> Hi everybody,
>>
>> What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
>> frameworks, now there is Spring Data Graph framework?
>>
>> I saw that Neo4J guys are working on both projects, so do you have any
>> preference for using one framework rather than the other?
>>
>> Michel.
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] 10 questions

2011-09-02 Thread Anders Nawroth
Hi!

>> All modifying operations need to be performed inside a transaction. In
>> most cases it makes sense to perform multiple operations in a single
>> transaction. For example in a web application it may be a good fit to
>> wrap the handling of one request in a transaction. So if a method
>> doesn't start a transaction, it just means that it's handled at a higher
>> level in the application.
> got this part. then do you suggest to leave indexing action outside of
> node operation? say i have a domain model and it handles indexing
> actions along with underlying nodes modification, then in an web app,
> should I wrap only nodes operations inside transaction and do indexing
> only after it success?

Seems like the node and index modifications belong in the same 
transaction, to make sure any modifications to nodes are always 
reflected in the indexes as well. Otherwise they could get out of sync 
if your application crashes after the commit of the first, 
node-modifying transaction.

/anders


>>
>>
>> /anders
>>
>>> 4, what's the best practice to do bulk insertion when running (not
>>> seed initial data)? i read post says that too many insertions within a
>>> transaction may lead to memory problem? what's the proper mount of
>>> insertion within a transaction?
>>> 5, is there a suggested max length for string/array property? would it
>>> be better to put into sql?
>>> 6, say a facebook user may "likes" thousands of things, and these
>>> things are sparsly connected. in this case, things should be modeled
>>> as nodes or array property?
>>> 7, where can i find an example to use domain models with serverplugin?
>>> i want to put my data in a standalone server and just use the
>>> serverplugin, unmanaged extension. should i just put the domain models
>>> into the same serverplugin jar?
>>> 8, the warning in the documentation about unmanaged extension is
>>> scary. what i can see is that people may use bad ways, instead of
>>> Iterator/IteratorWrappers. any comment on this?
>>> 9, i'm not sure if it's trival: find out users who are only 2
>>> relationships a way (use twitter example: my followees' followers),
>>> live in same city, group by age and gender. also retrieve all their
>>> followees. i want to do the traversal in java, where can i find an
>>> examples?
>>> 10, i've had horrible experience in turning jvm options. have neo4j
>>> been running on Zing JVM, hp nonstop jvm? are they better options?
>>>
>>> thanks in advance
>>>
>>>
>>> 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
>>
>
>
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] 10 questions

2011-09-02 Thread Linan Wang
Hi anders,
thanks for the clarification.

On Fri, Sep 2, 2011 at 8:32 AM, Anders Nawroth  wrote:
> Hi!
>
> 2011-09-01 03:29, Linan Wang:
>> 2, does index operation add/remove/modify threadsafe, don't need
>> lock/transaction?
>> 3, does it simple property writing operations also need to be wrapped
>> inside transaction? if so, in the imdb exmaple
>> tutor/domain/MovieImpl.java underlyingNode.setProperty is used neither
>> within transaction, nor put into a save method, do all setProperty
>> works inside a transaction?
>
> All modifying operations need to be performed inside a transaction. In
> most cases it makes sense to perform multiple operations in a single
> transaction. For example in a web application it may be a good fit to
> wrap the handling of one request in a transaction. So if a method
> doesn't start a transaction, it just means that it's handled at a higher
> level in the application.
got this part. then do you suggest to leave indexing action outside of
node operation? say i have a domain model and it handles indexing
actions along with underlying nodes modification, then in an web app,
should I wrap only nodes operations inside transaction and do indexing
only after it success?
>
>
> /anders
>
>> 4, what's the best practice to do bulk insertion when running (not
>> seed initial data)? i read post says that too many insertions within a
>> transaction may lead to memory problem? what's the proper mount of
>> insertion within a transaction?
>> 5, is there a suggested max length for string/array property? would it
>> be better to put into sql?
>> 6, say a facebook user may "likes" thousands of things, and these
>> things are sparsly connected. in this case, things should be modeled
>> as nodes or array property?
>> 7, where can i find an example to use domain models with serverplugin?
>> i want to put my data in a standalone server and just use the
>> serverplugin, unmanaged extension. should i just put the domain models
>> into the same serverplugin jar?
>> 8, the warning in the documentation about unmanaged extension is
>> scary. what i can see is that people may use bad ways, instead of
>> Iterator/IteratorWrappers. any comment on this?
>> 9, i'm not sure if it's trival: find out users who are only 2
>> relationships a way (use twitter example: my followees' followers),
>> live in same city, group by age and gender. also retrieve all their
>> followees. i want to do the traversal in java, where can i find an
>> examples?
>> 10, i've had horrible experience in turning jvm options. have neo4j
>> been running on Zing JVM, hp nonstop jvm? are they better options?
>>
>> thanks in advance
>>
>>
>> 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
>



-- 
Best regards

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


Re: [Neo4j] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Peter Neubauer
Michel,
IMHO the Spring Data Graph is a much broader approach to the problem,
although it brings with it more dependencies. I guess it is a matter of
choice. I would go for Spring Data Graph personally.

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 Fri, Sep 2, 2011 at 10:38 AM, Michel Domenjoud wrote:

> Hi everybody,
>
> What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
> frameworks, now there is Spring Data Graph framework?
>
> I saw that Neo4J guys are working on both projects, so do you have any
> preference for using one framework rather than the other?
>
> Michel.
> ___
> 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] Spring Data Neo4J vs. Tinker Pop's Frames/BluePrints?

2011-09-02 Thread Michel Domenjoud
Hi everybody,

What are Neo4J forecasts about Tinker Pop's Frames and Blueprints
frameworks, now there is Spring Data Graph framework?

I saw that Neo4J guys are working on both projects, so do you have any
preference for using one framework rather than the other?

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


Re: [Neo4j] Unable to being transaction

2011-09-02 Thread Dima Gutzeit
Any thoughts on the matter ?

It scares me that the database can stop processing requests like that,
unless I am doing something very illegal and wrong.

Thanks in advance.

Regards,
Dima Gutzeit.




On Thu, Sep 1, 2011 at 9:09 PM, Dima Gutzeit wrote:

> Here is the story. I had some problem with my index, some inconsistency,
> which cause lots of those:
>
> org.neo4j.graphdb.NotFoundException: phone property not found for
> NodeImpl#115.
> at
> org.neo4j.kernel.impl.core.Primitive.newPropertyNotFoundException(Primitive.java:172)
> ~[neo4j-kernel-1.4.jar:1.4]
> at
> org.neo4j.kernel.impl.core.Primitive.getProperty(Primitive.java:167)
> ~[neo4j-kernel-1.4.jar:1.4]
> at
> org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:145)
> ~[neo4j-kernel-1.4.jar:1.4]
> at
> com.foo.module.graph.actors.BaseGraphServiceActor.nodeTo(BaseGraphServiceActor.java:89)
> ~[module-neo4j-1.0-SNAPSHOT.jar:na]
> at
> com.foo.module.graph.actors.NodeManagerActor.updates(NodeManagerActor.java:118)
> ~[module-neo4j-1.0-SNAPSHOT.jar:na]
> at com.foo.module.graph.actors.NodeManager$$ProxiedByAWDelegation$$
> 1315857921056.aw$original$_AW_$updates$_AW_$com_foo_module_graph_actors_NodeManager$$ProxiedByAWDelegation$$1315857921056(Unknown
> Source) [aspectwerkz-2.2.3.jar:na]
> at
> com.foo.module.graph.actors.NodeManager$$ProxiedByAWDelegation$$1315857921056_1_
> 2012754604_1561793389___AW_JoinPoint.proceed(Unknown Source)
> [aspectwerkz-2.2.3.jar:na]
> at
> akka.actor.TypedActor$$anonfun$receive$1$$anonfun$apply$1$$anonfun$apply$2.apply(TypedActor.scala:227)
> [akka-typed-actor-1.2-RC5.jar:na]
> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
> [scala-library-2.9.0-1.jar:na]
> at
> akka.actor.TypedActor$$anonfun$receive$1$$anonfun$apply$1.apply(TypedActor.scala:216)
> [akka-typed-actor-1.2-RC5.jar:na]
> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
> [scala-library-2.9.0-1.jar:na]
> at
> akka.actor.TypedActor$$anonfun$receive$1.apply(TypedActor.scala:215)
> [akka-typed-actor-1.2-RC5.jar:na]
> at
> akka.actor.TypedActor$$anonfun$receive$1.apply(TypedActor.scala:213)
> [akka-typed-actor-1.2-RC5.jar:na]
> at akka.actor.Actor$class.apply(Actor.scala:551)
> [akka-actor-1.2-RC5.jar:na]
> at akka.actor.TypedActor.apply(TypedActor.scala:114)
> [akka-typed-actor-1.2-RC5.jar:na]
> at akka.actor.LocalActorRef.invoke(ActorRef.scala:905)
> [akka-actor-1.2-RC5.jar:na]
> at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25)
> [akka-actor-1.2-RC5.jar:na]
> at
> akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:216)
> [akka-actor-1.2-RC5.jar:na]
> at
> akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:122)
> [akka-actor-1.2-RC5.jar:na]
> at
> akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:188)
> [akka-actor-1.2-RC5.jar:na]
> at
> akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:122)
> [akka-actor-1.2-RC5.jar:na]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> [na:1.6.0_25]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> [na:1.6.0_25]
> at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
> at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:184)
> [akka-actor-1.2-RC5.jar:na]
>
> it happened only one some of the operations.
>
> Over time all operations started to fail with:
>
> org.neo4j.graphdb.TransactionFailureException: Unable to begin transaction
> at
> org.neo4j.kernel.EmbeddedGraphDbImpl.beginTx(EmbeddedGraphDbImpl.java:393)
> ~[neo4j-kernel-1.4.jar:1.4]
> at
> org.neo4j.kernel.EmbeddedGraphDatabase.beginTx(EmbeddedGraphDatabase.java:138)
> ~[neo4j-kernel-1.4.jar:1.4]
> at
> com.foo.module.graph.actors.NodeManagerActor.promoteNode(NodeManagerActor.java:228)
> ~[module-neo4j-1.0-SNAPSHOT.jar:na]
> at
> com.foo.module.graph.actors.NodeManagerActor.createNode(NodeManagerActor.java:55)
> ~[module-neo4j-1.0-SNAPSHOT.jar:na]
> at com.foo.module.graph.actors.NodeManager$$ProxiedByAWDelegation$$
> 1316234529667.aw$original$_AW_$createNode$_AW_$com_foo_module_graph_actors_NodeManager$$ProxiedByAWDelegation$$1316234529667(Unknown
> Source) ~[aspectwerkz-2.2.3.jar:na]
> at
> com.foo.module.graph.actors.NodeManager$$ProxiedByAWDelegation$$1316234529667_1_1717022187_920046141___AW_JoinPoint.proceed(Unknown
> Source) ~[aspectwerkz-2.2.3.jar:na]
> at
> akka.actor.TypedActor$$anonfun$receive$1$$anonfun$apply$1$$anonfun$apply$2.apply(TypedActor.scala:227)
> ~[akka-typed-actor-1.2-RC5.jar:na]
> at scala.util.DynamicVariable.withValue(DynamicVariable.scal

Re: [Neo4j] 10 questions

2011-09-02 Thread Anders Nawroth
Hi!

2011-09-01 03:29, Linan Wang:
> 2, does index operation add/remove/modify threadsafe, don't need
> lock/transaction?
> 3, does it simple property writing operations also need to be wrapped
> inside transaction? if so, in the imdb exmaple
> tutor/domain/MovieImpl.java underlyingNode.setProperty is used neither
> within transaction, nor put into a save method, do all setProperty
> works inside a transaction?

All modifying operations need to be performed inside a transaction. In 
most cases it makes sense to perform multiple operations in a single 
transaction. For example in a web application it may be a good fit to 
wrap the handling of one request in a transaction. So if a method 
doesn't start a transaction, it just means that it's handled at a higher 
level in the application.


/anders

> 4, what's the best practice to do bulk insertion when running (not
> seed initial data)? i read post says that too many insertions within a
> transaction may lead to memory problem? what's the proper mount of
> insertion within a transaction?
> 5, is there a suggested max length for string/array property? would it
> be better to put into sql?
> 6, say a facebook user may "likes" thousands of things, and these
> things are sparsly connected. in this case, things should be modeled
> as nodes or array property?
> 7, where can i find an example to use domain models with serverplugin?
> i want to put my data in a standalone server and just use the
> serverplugin, unmanaged extension. should i just put the domain models
> into the same serverplugin jar?
> 8, the warning in the documentation about unmanaged extension is
> scary. what i can see is that people may use bad ways, instead of
> Iterator/IteratorWrappers. any comment on this?
> 9, i'm not sure if it's trival: find out users who are only 2
> relationships a way (use twitter example: my followees' followers),
> live in same city, group by age and gender. also retrieve all their
> followees. i want to do the traversal in java, where can i find an
> examples?
> 10, i've had horrible experience in turning jvm options. have neo4j
> been running on Zing JVM, hp nonstop jvm? are they better options?
>
> thanks in advance
>
>
> 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