Interface Topic

Description

Represents a topic item.

Represents a topic item. See http://www.isotopicmaps.org/sam/sam-model/#d0e739. Inherited method getParent() from Construct returns the TopicMap to which this topic belongs. Inherited method addItemIdentifier() from Construct throws an IdentityConstraintException if adding the specified item identifier would make this topic represent the same subject as another topic and the feature "automerge" (http://tmapi.org/features/automerge) is disabled. Inherited method remove() from Construct throws a TopicInUseException if the topic plays a Role, is used as type of a Typed construct, or if it is used as theme for a Scoped construct, or if it reifies a Reifiable.

Located in /core/Topic.interface.php (line 37)

Construct
   |
   --Topic
Method Summary
void addSubjectIdentifier (string $subjectIdentifier)
void addSubjectLocator (string $subjectLocator)
void addType (Topic $type)
Name createName (string $value, [Topic $type = null], [ $scope = array()])
Occurrence createOccurrence (Topic $type, string $value, string $datatype, [ $scope = array()])
array getNames ([Topic $type = null])
array getOccurrences ([Topic $type = null])
array getRolesPlayed ([Topic $type = null], [Topic $assocType = null])
array getTypes ()
void mergeIn (Topic $other)
void removeSubjectIdentifier (string $subjectIdentifier)
void removeSubjectLocator (string $subjectLocator)
void removeType (Topic $type)
Methods
addSubjectIdentifier (line 62)

Adds a subject identifier to this topic.

Adds a subject identifier to this topic. If adding the specified subject identifier would make this topic represent the same subject as another topic and the feature "automerge" (http://tmapi.org/features/automerge/) is disabled, an IdentityConstraintException is thrown.

  • throws: ModelConstraintException If the subject identifier is null.
  • throws: IdentityConstraintException If the feature "automerge" is disabled and adding the subject identifier would make this topic represent the same subject as another topic.
  • access: public
void addSubjectIdentifier (string $subjectIdentifier)
  • string $subjectIdentifier: The subject identifier to be added; must not be null.
addSubjectLocator (line 96)

Adds a subject locator to this topic.

Adds a subject locator to this topic. If adding the specified subject locator would make this topic represent the same subject as another topic and the feature "automerge" (http://tmapi.org/features/automerge/) is disabled, an IdentityConstraintException is thrown.

void addSubjectLocator (string $subjectLocator)
  • string $subjectLocator: The subject locator to be added; must not be null.
addType (line 211)

Adds a type to this topic.

Adds a type to this topic. Implementations may or may not create an association for types added by this method. In any case, every type which was added by this method must be returned by the getTypes() method.

void addType (Topic $type)
  • Topic $type: The type of which this topic should become an instance of.
createName (line 135)

Creates a Name for this topic with the specified value, type, and scope.

Creates a Name for this topic with the specified value, type, and scope. If type is null the created Name will have the default name type (a Topic with the subject identifier http://psi.topicmaps.org/iso13250/model/topic-name).

  • return: The newly created Name.
  • throws: ModelConstraintException If the value is null or the type or a theme does not belong to the parent topic map.
  • access: public
Name createName (string $value, [Topic $type = null], [ $scope = array()])
  • string $value: The string value of the name; must not be null.
  • Topic $type: The name type. Default null.
  • array $scope: An array containing Topics - each representing a theme. If the array's length is 0 (default), the name will be in the unconstrained scope.
createOccurrence (line 169)

Creates an Occurrence for this topic with the specified type, value, datatype, and scope.

Creates an Occurrence for this topic with the specified type, value, datatype, and scope. The newly created Occurrence will have the datatype specified by datatype.

  • return: The newly created Occurrence.
  • throws: ModelConstraintException If either the value or the datatype is null; or the type or a theme does not belong to the parent topic map.
  • access: public
Occurrence createOccurrence (Topic $type, string $value, string $datatype, [ $scope = array()])
  • Topic $type: The occurrence type.
  • string $value: A string representation of the value; must not be null.
  • string $datatype: A URI indicating the datatype of the value; must not be null. E.g. http://www.w3.org/2001/XMLSchema#string indicates a string value.
  • array $scope: An array containing Topics - each representing a theme. If the array's length is 0 (default), the occurrence will be in the unconstrained scope.
getNames (line 117)

Returns the Names of this topic.

Returns the Names of this topic. If type is not null all names with the specified type are returned. The return value may be an empty array but must never be null.

  • return: An array containing a set of Names belonging to this topic.
  • access: public
array getNames ([Topic $type = null])
  • Topic $type: The type of the Names to be returned. Default null.
getOccurrences (line 148)

Returns the Occurrences of this topic.

Returns the Occurrences of this topic. If type is not null all occurrences with the specified type are returned. The return value may be an empty array but must never be null.

  • return: An array containing a set of Occurrences belonging to this topic.
  • access: public
array getOccurrences ([Topic $type = null])
getReified (line 227)

Returns the Construct which is reified by this topic.

Returns the Construct which is reified by this topic.

  • return: The Reifiable that is reified by this topic or null if this topic does not reify a statement.
  • access: public
Reifiable|null getReified ()
getRolesPlayed (line 185)

Returns the Roles played by this topic.

Returns the Roles played by this topic. If type is not null all roles played by this topic with the specified type are returned. If assocType is not null only the Associations with the specified assocType are considered. The return value may be an empty array but must never be null.

  • return: An array containing a set of Roles played by this topic.
  • access: public
array getRolesPlayed ([Topic $type = null], [Topic $assocType = null])
  • Topic $type: The type of the Roles to be returned. Default null.
  • Topic $assocType: The type of the Association from which the returned roles must be part of. Default null.
getSubjectIdentifiers (line 45)

Returns the subject identifiers assigned to this topic.

Returns the subject identifiers assigned to this topic. The return value may be an empty array but must never be null.

  • return: An array containing a set of URIs representing the subject identifiers.
  • access: public
array getSubjectIdentifiers ()
getSubjectLocators (line 79)

Returns the subject locators assigned to this topic.

Returns the subject locators assigned to this topic. The return value may be an empty array but must never be null.

  • return: An array containing a set of URIs representing the subject locators.
  • access: public
array getSubjectLocators ()
getTypes (line 198)

Returns the types of which this topic is an instance of.

Returns the types of which this topic is an instance of. This method may return only those types which where added by addType(Topic and may ignore type-instance relationships (see http://www.isotopicmaps.org/sam/sam-model/#sect-types) which are modeled as association. The return value may be an empty array but must never be null.

  • return: An array containing a set of Topics.
  • access: public
array getTypes ()
mergeIn (line 249)

Merges another topic into this topic.

Merges another topic into this topic. Merging a topic into this topic causes this topic to gain all of the characteristics of the other topic and to replace the other topic wherever it is used as type, theme, or reifier. After this method completes, other will have been removed from the TopicMap. If $this->equals($other) no changes are made to the topic. NOTE: The other topic MUST belong to the same TopicMap instance as this topic!

  • throws: ModelConstraintException If the two topics to be merged reify different Topic Maps constructs.
  • throws: InvalidArgumentException If the other topic to be merged does not belong to the same topic map.
  • access: public
void mergeIn (Topic $other)
  • Topic $other: The topic to be merged into this topic.
removeSubjectIdentifier (line 71)

Removes a subject identifier from this topic.

Removes a subject identifier from this topic.

  • access: public
void removeSubjectIdentifier (string $subjectIdentifier)
  • string $subjectIdentifier: The subject identifier to be removed from this topic, if present (null is ignored).
removeSubjectLocator (line 105)

Removes a subject locator from this topic.

Removes a subject locator from this topic.

  • access: public
void removeSubjectLocator (string $subjectLocator)
  • string $subjectLocator: The subject locator to be removed from this topic, if present (null is ignored).
removeType (line 219)

Removes a type from this topic.

Removes a type from this topic.

  • access: public
void removeType (Topic $type)
  • Topic $type: The type to remove.

Inherited Methods

Inherited From Construct

Construct::addItemIdentifier()
Construct::equals()
Construct::getId()
Construct::getItemIdentifiers()
Construct::getParent()
Construct::getTopicMap()
Construct::hashCode()
Construct::remove()
Construct::removeItemIdentifier()

Documentation generated on Sat, 15 Jan 2011 20:02:27 +0100 by phpDocumentor 1.4.1