[Neo4j] Re: Saving/Retrieveing Separate Graph Objects

2014-07-21 Thread Benjamin Makus
That sound's like you've got a tree (or several trees), and it looks like: ROOT-NODE /|\ (layer1)A1 A2A3 / \| | (layer2) B1 B2 B3B4 / \ (layer3) C1 C2 Something like this? Now you can of cours

[Neo4j] Re: ACL schema with Neo4j, data in MySQL/MongoDB

2014-07-19 Thread Benjamin Makus
I've now written parts of the query, but I can't get a few things working. It's basically this: IF( MATCH (u:User {name:'U1'})-[r:HAS_PERMISSION]->(o:Object {name:'O1' }) RETURN r.READ ) ELSE IF ( MATCH (u:User {name:'U1'}), (o:Obje

Re: [Neo4j] ACL schema with Neo4j, data in MySQL/MongoDB

2014-07-17 Thread Benjamin Makus
So... here is the Graph Gist: http://gist.neo4j.org/?github-benneq%2Fgists%2F%2Fmeta%2FSimple.adoc And the PDF (from the previous post): http://www.docdroid.net/er3w/acl-cheat-sheet.pdf.html *The permission resolution algorithm:* 1. Look if the User has a direct Permission relation to the Ob

Re: [Neo4j] ACL schema with Neo4j, data in MySQL/MongoDB

2014-07-15 Thread Benjamin Makus
Thanks for your answer. I'll try to clarify things a bit. First I created an ACL CHEAT SHEET: http://www.docdroid.net/er3w/acl-cheat-sheet.pdf.html There you can see lot's of different scenarios. The "*= +r*" and "*= -r*" behind the Obj-Nodes show what's the resulting permission for this Object.

Re: [Neo4j] Pros and cons about graph databses and especially Neo4j

2014-07-14 Thread Benjamin Makus
That is a problem in your applications architecture. If you use MySQL and have a on-to-many relation between A and B, and now you need to store an entity C between A and B, you've got to alter the schema and run an update on all entries. (if you can tell us a solution that works in SQL, than the

[Neo4j] Re: ACL schema with Neo4j, data in MySQL/MongoDB

2014-07-14 Thread Benjamin Makus
I now decided to use Neo4j as my main DB, this will simplify ACL stuff very much. So here's my basic schema: node User { String username } node Role { String name } relationship MEMBER_OF { } relationship PARENT_OF { } relationship HAS_PERMISSION { boolean read boolean update boolea

[Neo4j] Re: Saving/Retrieveing Separate Graph Objects

2014-07-13 Thread Benjamin Makus
There are no object types in Neo4j. There are basically 4 solutions for your problem: 1. search ALL nodes for property p = value (this will find ALL nodes which have a property named "p" with value "value") 2. use Labels. This way you can "tag" nodes. Each node can have multiple lab

[Neo4j] ACL schema with Neo4j, data in MySQL/MongoDB

2014-07-12 Thread Benjamin Makus
Hi, I'm writing a rather complex application, which stores its main data in MySQL and MongoDB. Now it's time for authorization, which should be ACL driven. And I'm looking for your advice whether to use Neo4j (within a Java/Spring environment) or not, and if yes, how to design the graph. *In