In the link provided it says
"We start with Groups, which contain members; the member can be either a person or another group (i.e. a member is a party)."
So the problem is what does "contain" mean here.
I think most folks would think if members can be groups than a group can have a membership relationship to another group. I guess the question is whether the membership relationship is inherited by the groups members or not.
Aha here is the mathematical descripton of the Sierra Club example.
A group Gc can be a member and/or a component of another group Gp; the difference is in the way the members of Gc are related to Gp:
*
If a party P is a member (or a component) of Gc and if Gc is a component of Gp, then P is also a member (or a component) of Gp
*
If a party P is a member (or a component) of Gc and if Gc is a member of Gp, then no relationship between P and Gp exists as a result of the relationship between Gp and Gp.
According to the design doc it IS possible to model what I said it was impossible to model. I wonder if it works or not.
We see:
openacs-5-3=# select membership_rel__new(1030,1036);
ERROR: -20001: membership_rel violation: Invalid object types. Object 1030 (group) must be of type group Object 1036 (group) must be of type person
CONTEXT: SQL statement "insert into acs_rels (rel_id, rel_type, object_id_one, object_id_two) values ( $1 , $2 , $3 , $4 )"
PL/pgSQL function "acs_rel__new" line 25 at SQL statement
PL/pgSQL function "membership_rel__new" line 11 at assignment
PL/pgSQL function "membership_rel__new" line 5 at return
It does not work. IT says ONLY persons may be members of groups, which is what Malte has been trying to fix. Its clear the original design document says any party may be a member of a group. This may have changed when relational_segments were added to the data model.
Its not clear, I checked the earliest code OpenACS has and membership rel always required a group and a person.
attr_id := acs_rel_type__create_type (
''membership_rel'',
''Membership Relation'',
''Membership Relationships'',
''membership_rels'',
''rel_id'',
''membership_rel'',
''group'',
null,
0,
null,
''person'',
''member'',
0,
null
);
To change that now we'd need a comprehensive test suite to prove correctness of security and memebership inheritance. I think it would be cool if it was fixed because it would be much simpler for end users as composition rels are quite hard for people to understand.