Retrieving Information From A Schema

The NPCL API provides a small number of functions for retrieving type and constraint information from a schema. The key methods are all found on the ISchema interface. This interface provides properties TopicTypes, OccurrenceTypes, AssociationTypes, RoleTypes and ScopingTopics that return the types and scoping topics in the schema. This interface also provides methods named GetTopicType(), GetOccurrenceType() etc. that return the type with the specified subject identifier. The method GetSchemaTypes() returns all types with the specified subject identifier (as one subject identifier can be used on several different types).

Finally the ISchema interface provides three additional lookup methods. The method GetPlayerTypesForRole(IRoleType, IAssociationType) returns all ITopicType instances that are allowed to play the specified type of role in the specified type of association. The method GetPlayerConstraintsForRole(IRoleType) returns all IRolePlayerConstraint instances that reference the specified IRoleType. The method GetAssociationTypesForRole(IRoleType) returns all IAssociationTypes that allow a role of the specified type to appear.