Currently a node reference does not actually have a semantic meaning besides the possibility to have different fields for different meanings. Wouldn't it be cool to use the power of taxonomy and combine it with the one of node reference?
Example as it works noe with one content type:
Nodes: A, B, C, D, F
Fields: content_field_father_ref, content_field_son_ref, content_field_sibling_ref, content_field_mother_ref
Relationships:
content_field_father_ref
A - B
content_field_son_ref
B - A
content_field_sibling_ref
B - D
D - B
content_field_mother_ref
C - B
C - D
This of cause is not a particular flexible or nice way to accomplish meaningful relationships as for every meaning you need an additional field.
More meaningful and flexible would be to tag node references with taxonomy terms:
Fields: content_field_reference
Taxonomy Terms: [1] father, [2] son, [3] sibling, [4] mother
A -2- B (A is father of B)
C -4- B (C is mother of B)
C -4- D (C is mother of D)
B -2- A (B is son of A)
B -3- D (B is sibling of D)
D -3- B (D is sibling of F)
There are other possibilities to accomplish semantic relationships (e.g. via nodes in the middle or on terms for each relationship) but they are workarounds at best.
Database wise all we would need is an optional additional column at each node reference table with the tid. Another possibility would be to add a key to any reference and use this key in a reference_term table. That would be closer to how taxonomy works with nodes but I think it would be too much overhead for the benefit of having multiple tags on one node reference.
Summary:
Relationships are an important to create a model of reality but in reality relationships always actually mean something. It is a simple feature but brings incredible flexibility. Of cause if http://drupal.org/project/awesomerelationship module gets finished this might not be needed any more but I fear this might take a while so maybe we could have this feature baked into node_reference module.
Comments
Comment #1
BenK commentedSubscribing...
Comment #2
colanSubscribing.