Forum OpenACS Development: Parties, Persons, Groups and Group Membership

In the Parties in OpenACS 4.6.3 page under the section "Group Relations" (about 1/2 way through the page), it says the following:

But just because you are a member of an organization that is a member of Greenpeace, that doesn't make you a member of Greenpeace, i.e., membership is not transitive with respect to itself. Now let's consider a multinational corporation. This corporation might have a U.S. division and a European division. A member of either the U.S. or European division is automatically a member of the company. In this situation the U.S. and European divisions are "components" of the company, i.e., membership is transitive with respect to composition.

I tried to replicate this example stucture with the following PL/SQL code:

-- -*- mode: sql;	tab-width: 4; -*-   EMACS display variables
declare
	gid0	integer;
	gid		integer;
	pid		integer;
	cid		integer;
	mid		integer;
begin
	gid0 := acs_group.new(group_name => 'Sony');
	pid := person.new(	email => 'joe@not-really-sony.com',
						first_names => 'Joe',
						last_name	=> 'Smith');
	mid := membership_rel.new(object_id_one => gid0, object_id_two => pid);

	pid := person.new(	email => 'jane@not-really-sony.com',
						first_names => 'Jane',
						last_name	=> 'Smith');
	mid := membership_rel.new(object_id_one => gid0, object_id_two => pid);

	gid := acs_group.new(group_name => 'Greenpeace');
	cid := composition_rel.new(object_id_one => gid, object_id_two => gid0);

	gid := acs_group.new(group_name => 'The Sierra Club');
	mid := membership_rel.new(object_id_one => gid, object_id_two => gid0);
end;
/
show errors
As a result, Joe and Jane, both members of Sony, became members of Greenpeace. My attempt at creating the membership_rel between The Sierra Club and Sony failed due to a type error. I investigated the acs-kernel datamodel and indeed the types required for each _rel are as follows:
composition_rel relates group to group
membership_rel relates group to person
Am I wrong in thinking this doesn't correspond to the description given in the documentation? Shouldn't the membership_rel relate a group to a party at which point the non-transitivity of membership would be evident?

If the situation described in the documentation is not meant to be implemented in this way, what's the point of having separate compisition_rels and membership_rels when a single membership_rel could relate groups to partys?

Collapse
Posted by tammy m on
Take a look at this groups tutorial. I think you need to add members to your groups with
# Add a user in a role
relation_add -member_state "approved" \
        $role $app_grp $member_id
.
Collapse
Posted by Jade Rubick on
Andrew, if you think the documentation is lacking, please also file this in bug-tracker.
Collapse
Posted by Tilmann Singer on
One remaining difference between membership and composition relation is that the membership relation includes a state (e.g. 'approved'), so the distinction would still make sense.

To make membership_rel relate group->party instead of group->person was clearly the intention looking at the doc, and I wonder wether it was just an oversight from the person writing acs-kernel/sql/xxx/groups-create.sql or if it was implemented like this for a reason. So either it is a code bug or a documentation bug.