NetworkedPlanet | TMCore Engine API Guide |
The following list shows the mappings that are made between XTM elements and TMCore interfaces and properties.
Whenever a subjectIndicatorRef
element is
encountered where its parent is not a
subjectIdentity
element, it is mapped to a
Topic with the subjectIndicatorRef
address as
one of its SubjectIdentifiers property values
or one of its SourceLocators property
values.
The ITopicName
interface and
TopicNames property of the
ITopic
interface map to the XTM
baseName
element.
The SubjectLocators property of
Topic
maps to the
subjectIdentity/resourceRef
element.
Under the XTM 1.0 data model, a topic can only have one subject locator. However the proposed XTM 1.1 data model extends this to allow a topic to have multiple subject locators. In the TMCore API, the property is represented as an IList of strings to support this future extension.
The SubjectIdentifiers property of
ITopic
maps to the
subjectIdentity/subjectIndicatorRef
elements.
Each IAssociationRole
instance maps to one combination of roleSpec
and topicRef
or
subjectIndicatorRef
inside an
association/member
element. The
member
element actually allows multiple
topicRef
or
subjectIndicatorRef
elements to appear after
the roleSpec
, however in TMCore system, these
are "flattened" into a list of pairs of ITopic instances. For
example given an association like this in XTM:
<association> <instanceOf><topicRef xlink:href="#works-for"/></instanceOf> <member> <roleSpec><topicRef xlink:href="#employer"/></roleSpec> <topicRef xlink:href="#boulder-rock-company"/> </member> <member> <roleSpec><topicRef xlink:href="#employee"/></roleSpec> <topicRef xlink:href="#fred"/> <topicRef xlink:href="#barney"/> </member> </association>
The resulting TMAPI representation would be an Association instance containing three AssociationRole instances (in its associationRoles property).
Nested variant
elements in XTM syntax are
"flattened" in the TMCore API to a single level of
IVariant
children of the
ITopicName
instance. The
IVariant
instances have all the
parameters specified on the variant
element
itself plus all those specified on its ancestor
variant
elements.
The list of parameters for a variant
can
be found in the Scope property of the
IScopedObjects
interface (which is
a superclass of the IVariant interface).
If the content of an occurrence
or
variant
is a resourceData
element, then the string content of the
resourceData
element can be retrieved from the
Value property of the
IOccurrence
or
IVariant
interface. If the content
is a resourceRef
element, then the string which
represents the address pointed to be the
resourceRef
link can be retrieved from the
Resource property instead.