cancel
Showing results for 
Search instead for 
Did you mean: 

How and if implement ISA relationship in neo4j

paolodipietro58
Graph Voyager

I have an UML diagram that describe a classification tree with a three level hierarchy of classes: Just imagine A, B and C where Ais the top level class and B IS_A A and C IS_A B.

Each class has it's own properties and the classes at the lower level of the hierarchy inherits the properties of the parent class.

Which is the best way to implement this using neo4j?

My preferred is to create a node with label :A, another with label :A:B and the last with label :A:B:C

But it mixes up all the properties and I cannot see only the :A subset of properties of an A:B:C node.

Another approach is to create just one A nodes, one B nodes and one C nodes and relate them with an IS_A relationship.

Then I can create a new node named 'doe` and a relationship IS_ISTANCE_OF between this and A or B or C. But I don't like.

Any suggestion?

8 REPLIES 8

glilienfield
Ninja
Ninja

How are these nodes going to be used? What kind of queries or operations need to be performed on these nodes?

Well, the question is more complicated.

The tree, which is more complex, represent a list of hw devices: the top level is the provider, the second level is the device, the third level is the model, the fourth level is the version.

There is another tree: User and roles: a user can have multiple roles.

But Imagine I have three kind of roles: owner, employee, administrator

I want to associate to each type of fourth level devices a set of permission for each abstract role.

Then I want to connect a User with each of the possible roles he can cover.

Finally, I want to know what are the permissions of the user JohnDoe with a specific role, on a specific level4 device.

I hope to have explained the goal.

glilienfield
Ninja
Ninja

You are correct; there is a low to unpack there.

Questions:

  1. Is the most granular access/restriction granted at the permission level?
  2. Are roles a specific collection of permissions?
  3. Access/restrictions are being granted at the fourth level (version) only?
  4. Do you assign a role to the version, thus the users with that role gets all the role's permissions for that version? Or, each version can be granted a subset of a roles permissions?

  1. YES
  2. YES
  3. NO, there could be some default at any superior level, which should be inherited by lower levels
  4. Same as 3) A role can be assigned to a superior level, and the permission should be available for all the descending part of the tree, down to the level 4

glilienfield
Ninja
Ninja

Sorry, I have been sick for over a week. Are you still looking at this, or have you solved your problem?

Well, I'm working on it, but I have more substantial troubles, where the manual suggest a syntax but it returns an error. I'll post it. Stay well and recover!

And, if you want to give a look at this https://community.neo4j.com/t/auto-transaction-doesnt-run-as-described-in-the-manual/55847

I checked the link. Try this:

:auto LOAD CSV WITH HEADERS FROM 'file:///transactions.csv' AS row FIELDTERMINATOR ';'

WITH row  WHERE row.id IS NOT NULL


CALL 
{
WITH row




@ameyasoft : we are going ahead, check this thread if you like! Thank you! https://community.neo4j.com/t/auto-transaction-doesnt-run-as-described-in-the-manual/55847