Classifying associations

Associations have a rich semantic and therefor there is a large spectrum of how they may be transformed into abstract models.

Panckoucke comes with 6 predefined classification schemes, each of them incorporating a different view on the associations where a given Topic t0 plays a role.

The following are the 6 predefined classification schemes:

The following gives you a more detailed description how the choice of the classification-scheme influences the resulting model.

Choosing a classification scheme

To choose a particular classification scheme, you pass an AbstractionContext that specifies the scheme you want to use. To do so, you set an abstraction hint with the name that is defined in the public static field AssociationCompressDispatcher.ASSOCIATION_COMPRESSION. As the value of the hint you use a String constant that identifies the particular scheme.

For every supported scheme, the class AssociationCompressDispatcher defines a public static String, that serves to identify the scheme. See the discussion of the available schemes below for the particular constants to use.

For example, setting the byRolesOfCenter-Classification scheme, you can use code like this:

    
    AbstractionContext abstractionContext;
    ...
    
    Properties hints = abstractionContext.getAbstractorHints();
    hints.setProperty(AssociationCompressDispatcher.ASSOCIATION_COMPRESSION,
                      AssociationCompressDispatcher.CS_L2_BY_ROLE_OF_CENTER);
	

byRoleOfOthers

This classification scheme groups all role-playing-topics under the role that they play in one of the considered associations.

The considered associations are: All associations where t0 plays a role in.

The hint value is defined by the field: AssociationCompressDispatcher.CS_L2_BY_ROLE_OF_OTHERS

The following characteristics apply

  • The resulting graph is rather compact.
  • The role-playing topics are used as endnodes of arcs that start at topic t0.
  • For each role, that is played by an topic other that t0, one arc is created.
  • The arc represents the role that the players play.
  • All players that play that role, are added as endnodes.
  • Additional information that is contained in the original topic map graph gets lost. This includes membership in particular associations, the type of the associations or the role that t0 plays.

For test topic john, the result looks like this:

byRoleOfCenter

This classification scheme groups all role-playing-topics under the role that t0 plays in one of the considered associations.

The considered associations are: All associations where t0 plays a role in.

The hint value is defined by the field: AssociationCompressDispatcher.CS_L2_BY_ROLE_OF_CENTER

The following characteristics apply

  • The resulting graph is rather compact.
  • The role-playing topics are used as endnodes of arcs that start at topic t0.
  • For each role, that is played by t0, one arc is created.
  • The arc represents the role that t0 plays.
  • All players that are part of associations where t0 plays that particular role, are added as endnodes.
  • Additional information that is contained in the original topic map graph gets lost. This includes membership in particular associations, the type of the associations or the role that other topics play.

For test topic john, the result looks like this:

byTypeOfAssociation

This classification scheme groups all role-playing-topics under the type of one of the considered associations.

The considered associations are: All associations where t0 plays a role in.

The hint value is defined by the field: AssociationCompressDispatcher.CS_L2_BY_TYPE_OF_ASSOC

The following characteristics apply

  • The resulting graph is rather compact.
  • The role-playing topics are used as endnodes of arcs that start at topic t0.
  • For each type, that an association is of, one arc is created.
  • The arc represents the type of that association.
  • All players that are part of associations that are of the particular type, are added as endnodes.
  • Additional information that is contained in the original topic map graph gets lost. This includes membership in particular associations, the role t0 plays or the role that other topics play.

For test topic john, the result looks like this:

byRoleTypePlayer

This classification scheme groups the considered associations in three steps.

In the first step, the associations are grouped under the role that t0 plays. The second step bundles the associations under their type.Finally, in the third step, the associations are grouped by the number of their members and the roles that are played.

Considered associations: All associations where t0 plays a role in.

Identifier: The hint value is defined by the field: AssociationCompressDispatcher.CS_L6_BY_ROLE_TYPE_PLAYER

The following characteristics apply

  • The resulting graph is rather deep (6 levels).
  • In addition to the classified associations the resulting graph contains all players of the associations, hooked to their containing association by arcs that represent the role-defining-topic.
  • All information that is contained in the original topic map graph is preserved.

For test topic john, the result looks like this:

Classified by a shelfmark, using the matrix-pattern

This classification scheme uses an implementation of org.tm4j.panckoucke.impl.abstraction.Shelfmark to group associations.

After all associations are classified, each of the resulting groups is transformed into an AbstractModel by using the matrix pattern.

Considered associations: All associations where t0 plays a role in.

Identifier: The field AssociationCompressDispatcher.CS_MATRIX_BY_ROLES defines a classification scheme that uses the Shelfmark-implementation org.tm4j.panckoucke.impl.abstraction.AssociationRoleShelfmark..

The following characteristics apply

  • Every group of associations is transformed using the matrix-pattern.
  • All matrix - nodes are added as endnodes to an arc with AMGestaltPLAYER. The startnode of that arc is the topic t0

For the owns-car-associations of test topic john, the result looks like this:

Umcompressed

This scheme transforms the considered associations to a model that resembles the structure of the topicmap graph as it is build in tm4j.

The considered associations are: All associations where t0 plays a role in.

The hint value is defined by the field: AssociationCompressDispatcher.CS_L4_UNCOMPRESSED

The following characteristics apply

  • The resulting graph is rather deep (4 levels).
  • All information that is contained in the original topic map graph is preserved.
  • No classification is be done.

For test topic john, the result looks like this: