NetworkedPlanet | TMCore Engine API Guide |
The NPCL data model is represented by a collection of interfaces as shown in the table below.
Table 12.1. Interfaces Representing the NPCL Model
Interface Name | Notes |
---|---|
ISchema | Represents an NPCL schema. Contains lists of all of the different types contained in the schema and provides index methods for finding types and constraints by several different criteria. |
ISchemaItem | The base interface for all types and constraints in a schema. Provides methods for retrieving or modifying the extension values on a schema item. |
IType | The base interface for all types in a schema. Derived from ISchemaItem, this interface adds support for getting/setting the display name and subject identifiers of a type and for getting/setting the Is Abstract Facet value. |
IValueType | The base interface for types that support Value Facets. Derived from IType, this interface adds support for getting/setting the Datatype, Minimum Value, Maximum Value and Value Pattern Facets. Currently only the IOccurrenceType interface is dervied from this interface. |
IAbstractType | Represents an Abstract Type in the schema - a topic that participates in the class hierarchy, but is not one of the concrete meta-types. |
IAssociationType | Represents an Association Type in the schema. Derived from IType, this interface adds support for getting/creating/removing the Association Role Constraints that apply to the Association Type. |
IOccurrenceType | Represents an Occurrence Type in the schema. This interface is dervied from the IValueType interface. |
IRoleType | Represents a Role Type in the schema. This interface is dervied from the IType interface. |
ITopicType | Represents a Topic Type in the schema. Derived from the IType interface, this interface adds support for getting/creating/removing the Occurence Constraints and Role Player Constraints that apply to the Topic Type. |
IScopingTopic | Represents a Scoping Topic in the schema. This interface is derived from IType. |
IConstraint | The base interface for representation of constraints in the schema. This interface is derived from ISchemaItem and adds support for getting/setting the Minimum Cardinality and Maximum Cardinality Facets. |
IAssociationRoleConstraint | Represents an Association Role Constraint. Derived from IConstraint, this interface adds support for retrieving the Association Type and Role Type that participate in the constraint and for getting/setting the Arc Label Facet for the constraint. |
IOccurrenceConstraint | Represents an Occurrence Constraint. Derived from IConstraint, this interface adds support for retrieving the Topic Type and Occurrence Type that participate in the constraint. |
IRolePlayerConstraint | Represents a Role Player Constraint in the schema. This interface is dervied from IConstraint and adds support for retrieving the Association Type, Role Type and Topic Type that participate in the constraint. |
To work with the API it is important to understand the containment hierarchy of the NPCL model - that is, which items in the model are "parents" that contain other items in the model. The containment hierarchy is quite simple and is shown in the UML diagram below - the black diamond indicates the "container" and the undecorated end indicates the "contained" item.
In addition to the interfaces that represent the schema model, the
NetworkedPlanet.Npcl namespace provides classes for loading schema
information from an XML file or from a topic map and for writing schema
information to an XML file or topic map. In addition several convenience
methods are provided in the class
NetworkedPlanet.Npcl.SchemaUtils
. These utility
classes are described in more detail in the following chapter on using the
API.