UpdateTopic Element

This operations specifies a new set of names, occurrences and identifiers to be assigned to an existing topic in the topic map. The new data completely replaces all existing names, occurrences and identifiers, but the roles played by the topic in associations are not modified by this action. The txn:UpdateTopic element has the following structure:

Note

It is important to note that this action completely overwrites any existing identiiers, names or occurrences on the target topic. If you just wish to add new identifiers, names or occurrences use the CreateTopicProperty method. If you wish to remove some identifiers, names or occurrences but leave others intact, use DeleteTopicProperty. A combination of DeleteTopicProperty and CreateTopicProperty can be used to modify a specific item (by deleting it and creating it with a new value in a single TopicMapTransaction).

<txn:UpdateTopic id="..." create="true|false">
  <tmd:topic oid="..." subjectIdentifier="..." subjectLocator="..." sourceLocator="...">
    ...
  </tmd:topic>
</txn:UpdateTopic>
    
txn:UpdateTopic

The wrapper element for the UpdateTopic action.

txn:UpdateTopic/@id

The identifier for this operation. This identifier is used to correlate any error messages to the operation that caused the error.

txn:UpdateTopic/@create

A boolean flag indicating if the topic should be created if it does not already exist.

txn:UpdateTopic/tmd:topic

This REQUIRED element from the Topic Map Fragment XML Schema provides the new details to be applied to the topic. The topic that the update is applied to is identified by one of the two optional attributes on this element.

txn:UpdateTopic/tmd:topic/@oid

This OPTIONAL attribute directly identifies the topic to be updated. The value of this attribute may be either an integer database object identifier, or the string identifier of a topic created in this a previous action contained in the current request document. If the topic cannot be found in the database and the create attribute of the UpdateTopic element is set to true, then a new topic will be created and will be accessible in the current transaction either using its actual object identifier, or using the oid value specified by this attribute.

Note

The system will always attempt to process an integer oid attribute value as a database object identifier, so it is important when creating new topics using this interface that you only assign non-integer values to the oid attribute of topics and associations created using the CreateTopic or CreateAssociation actions.

txn:UpdateTopic/tmd:topic/@subjectIdentifier

This optional attribute identifies the topic to be updated by its subject identifier. This attribute will be processed ONLY IF the oid attribute is not present. If the topic cannot be found in the database and the create attribute of the UpdateTopic element is set to true, then a new topic will be created in the topic map.

txn:UpdateTopic/tmd:topic/@subjectLocator

This optional attribute identifies the topic to be updated by its subject locator. This attribute will be processed ONLY IF the oid and subjectIdentifier attributes are not present. If the topic cannot be found in the database and the create attribute of the UpdateTopic element is set to true, then a new topic will be created in the topic map.

txn:UpdateTopic/tmd:topic/@sourceLocator

This optional attribute identifies the topic to be updated by its source locator. This attribute will be processed ONLY IF the oid, subjectIdentifier and sourceLocator attributes are not present. If the topic cannot be found in the database and the create attribute of the UpdateTopic element is set to true, then a new topic will be created in the topic map.

txn:UpdateTopic/tmd:topic/@version

This OPTIONAL attribute identifies the version of the topic to be updated. The topic will only be updated if its current version number matches the value of this attribute. If the topic's current version number does not match the value specified here, then an error will be returned.

If this attribute is ommitted, the update will be applied to the latest version of the topic.

Note

Although the Topic Map Fragment XML Schema allows the oid, subjectIdentifier, subjectLocator and sourceLocator attributes to be ommitted, this action requires that at least one of these attributes has a value.

Note

This action will update the names, occurrences and identifiers of the topic only. The contents of a tmd:associations element inside the tmd:topic element will be ignored by this operation.