The Web Graph Database

wiki:Docs/ModelLookup

Looking up Model information (meta-data) at run-time

InfoGrid makes all Model information (i.e. all meta-data) available at run-time for MeshObjects.

Related to EntityType

Given a MeshObject:

MeshObject obj = ...;

To determine the EntityTypes with which it is blessed:

EntityType [] types = obj.getTypes();

To determine whether the MeshObject is blessed with a particular EntityType:

EntityType toCheck = ...;
if( obj.isBlessedBy( toCheck )) {
    ...
}

Related to PropertyType

To determine all PropertyTypes currently available:

PropertyType [] propertyTypes = obj.getAllPropertyTypes();

To determine the values of all Properties:

PropertyType []  propertyTypes  = obj.getAllPropertyTypes();
PropertyValue [] propertyValues = obj.getPropertyValues( propertyTypes );

They PropertyValues will be returned in the same sequence as the PropertyTypes.

Related to RoleType

To determine the all RoleTypes that the MeshObject currently plays:

RoleType [] allRoleTypes = obj.getAllRoleTypes();

To also determine with which neighbor MeshObject the MeshObject currently plays which RoleType:

Role [] allRoles = obj.getRoles();

Role brings together both the RoleType and the neighbor MeshObject.

To determine the RoleTypes that the MeshObject currently plays with a given neighbor MeshObject:

MeshObject  neighbor     = ...;
RoleType [] withNeighbor = obj.getRoleTypes( neighbor );

Traversing the Model further

The MeshTypes constituting the Model can be fully explored through methods exposed on the various MeshTypes.

For example, given an EntityType, determine which RelationshipTypes require this EntityType as source or destination:

EntityType  type = ...;
RoleType [] playsRoleTypes = type.getAllRoleTypes();
Last modified 4 years ago Last modified on 01/19/10 06:24:40