cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Modeling codes and labels

Hi all.
How do go about modeling codes and their labels?
Say I have a person status that is represented by an integer code in the person node (1, 2).
Where would you hold the labels info for these codes: 1=Active and 2=Inactive?

I thought of a a detached branch in the DB for all these codes-labels chains for all such fields, like:
SystemTables -> PersonStatus -> 1=Active -> 2=Inactive
SystemTables -> MembershipLevel -> 1=Lead -> 2=Pre-Member -> 3=Subscribed

Any other ideas?

5 REPLIES 5

asperlinga
Graph Buddy

I think that PersonStatus and MembershipLevel are properties of Person:

ciao

Alessio

Thanks Alessio.
Yes, they are, but I'm just storing the numeric code for every person:
Status=1
MembershipLevel=3

Storing just a numeric code ("1") instead of a string ("Active") should save a lot of space for Million members (and that just for onen field. Like Status and MemebershipLevel I have many other codes fields in the system).

I need to store somewhere the labels per each code I'm using:
1 represents "Active"
2 represents "Inactive"
etc...

My question is how should I model the small storage of just the codes' labels (meaning).

Hi Mor,

The first Idea is to create a little graph named "Legenda" with all the decode of the value of the structure.

ciao

Alessio

Yes, that was my initial thought. I thought there's something more elegant I'm missing here...
Thanks!

asperlinga
Graph Buddy

I think that MembershipLevel is self-explanatory, for binary value as Active/Inactive you can use the standard 0=false 1=true

Alessio