|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.tm.TopicMapProcessor
public class TopicMapProcessor
Defines a processor for topic map events generated by a parser (i.e., a topic map engine), providing access to a consistent TopicMap object and individual objects within. This also makes available a number of static and non-static utility methods for querying and modifying the TopicMap. The latter makes this a rather large class, but for convenience' sake this seems a better approach than breaking off a utility class that would exist in memory anyway.
Speaking of which, there are several utility interfaces and classes that
will generally be included with a TopicMapProcessor:
Inferencer, PSIUtils,
TopicLocatorPool, TopicMapBuilder,
TopicNameIndex, plus all the utility classes that
are part of TM4J.
TopicMapManager interface.
It currently does not fully implement the API at this time. Some of the
existing notes in the class still pertain to the API and these are not
being altered because the plan is to eventually re-implement it.
TopicMap,
TopicMapFactory,
TopicMapProvider| Field Summary | |
|---|---|
static boolean |
exportImpliedIDs
When true, exported topic maps include implied IDs. |
static boolean |
exportResourceIDs
When true, exported topic maps include resource IDs. |
static String |
idPrefix
IDGenerator prefix for all auto-created IDs. |
static String |
PROP_REFLEXIVE_TO
The base URI for the property determining if reflexive relations are represented as two "To" (value="true") or two "From" (value="false", or unset) roles. |
static int |
PROVIDER_HIBERNATE
Indicator constant for Hibernate DB provider implementation. |
static int |
PROVIDER_MEMORY
Indicator constant for in-memory provider implementation. |
static int |
PROVIDER_OZONE
Indicator constant for Ozone DB provider implementation. |
protected boolean |
useCeryleLTMProcessor
When true, uses Ceryle's LTM processor rather than TM4J's. |
| Constructor Summary | |
|---|---|
protected |
TopicMapProcessor(int backend)
Constructor with an int backend indicating which backend the processor should use to store topic map information. |
| Method Summary | |
|---|---|
boolean |
addType(Topic topic,
Topic type)
Add the typing Topic to the Topic, returning true if successful. |
void |
clearTemplates()
Clears any existing Association templates from the cache. |
static Topic[] |
convertScopeToArray(Set scope)
Converts a Set of Topics into an array used as a Scope. |
static Set |
convertScopeToSet(Topic[] scope)
Converts an array of Topics (comprising a Scope) into a Set used as a Scope. |
Association |
createBinaryAssociation(Topic type,
Topic[] scope,
Topic role1,
Topic player1,
Topic role2,
Topic player2)
Creates a binary association between the two players having two roles, a type and optional scope. |
Topic |
createFacet(Topic faceted,
Topic[] facetScope,
Topic facetType,
Topic facetConstraint,
String facetValue)
Creates a new facet for the Topic faceted. |
TopicMap |
createTopicMap(Locator locator)
Creates a new, empty TopicMap provided a base Locator. |
TopicMap |
createTopicMap(TypedInputSource source)
Parses a topic map document (in XTM, LTM, or AsTMa= notation), specified by the system identifier (URI) systemId, returning the TopicMap object. |
void |
deregisterProvider(String id)
Deregisters the provider whose ID is id. |
String |
generateID()
Uses the existing IDGenerator to return a unique ID. |
String |
generateID(TopicMap topicmap)
Uses the existing IDGenerator to return a unique ID within the provided TopicMap topicmap. |
String |
generateID(TopicMap topicmap,
String prefix)
Uses the existing IDGenerator to return a unique ID within the provided TopicMap topicmap, prefixed with the String prefix. |
String |
generateIDFromName(TopicMap topicmap,
String name)
Uses the existing IDGenerator to return a unique ID within the provided TopicMap topicmap based on the String name. |
Topic |
getAboutTopic(TopicMap topicmap,
boolean create)
Returns the 'about' Topic of TopicMap topicmap, creating it if it does not yet exist, if the boolean create is true. |
Association |
getBinaryAssociation(Topic type,
Topic topic1,
Topic topic2)
Returns the first found (existing) Association having type between Topic topic1 and topic2 (paying no attention to which role each plays). |
String |
getDescription(Topic topic)
Returns a textual description of the supplied Topic topic, considered the first encountered Occurrence of a type matching the Ceryle 'description' PSI http://purl.org/ceryle/psi/ceryle/#Description. |
String |
getDisplayName(Topic topic,
Topic[] scope)
Returns a String which may be used as a display name in the specified scope. |
String |
getID()
Returns a unique identifying String for this TopicMapProcessor, based on a timestamp. |
static String |
getIdentifier(TopicMap topicmap)
Returns a String identifier for the provided TopicMap topicmap, its name if available, otherwise, its base locator address. |
IDFactory |
getIDFactory()
Returns the existing IDFactory. |
String |
getIDofTopicType(TopicMap tm,
Topic type)
Returns the ID of the first-encounted Topic having the given type. |
Inferencer |
getInferencer()
Return a lazily-created Inferencer. |
String |
getLabel(Association assoc)
Returns a label for the provided Association assoc by using its typing topic's display name, one of its base names, or its ID. |
String |
getLabel(Topic topic)
A convenience method that calls getLabel(Topic,Topic[])
with a null Scope parameter. |
String |
getLabel(Topic topic,
Topic[] scope)
Returns a label for the provided Topic topic in the optional Topic[] scope, in order of availability. |
int |
getOccurrenceCount(Topic topic,
boolean ignoreUtility)
Returns the number of Occurrences. |
Occurrence |
getOccurrenceOfType(Topic topic,
Topic type)
Returns the first encountered occurrence in the supplied Topic topic, of an occurrence whose type matches type. |
Collection |
getOccurrences(Topic topic,
boolean ignoreDescription)
Returns the Occurrences of Topic topic as a Set. |
Topic[] |
getOrderedRolesForTemplate(Topic type)
Returns the two player Topics of the Association template matching the Topic type, based on the directedness of the Association. |
Set |
getPlayersOfRoleInTypedAssociation(Topic topic,
Topic topicType,
Topic assocType,
Topic role,
Set set)
Returns all Topics playing role in associations with the Topic topic. |
TopicLocatorPool |
getPool()
Returns the TopicLocatorPool used by this TopicMapProcessor. |
TopicMapProvider |
getProvider()
A functional synonym for getTopicMapProvider(TopicMap). |
TopicMapProvider |
getProvider(TopicMap topicmap)
Returns the TopicMapProvider for the TopicMap topicmap. |
Map |
getProviders()
Returns a map containing the TopicMapProviders with their IDs as keys. |
PSIUtils |
getPSI()
Returns the PSIUtils used by this TopicMapProcessor. |
Vector |
getPublicationMetadata(TopicMap topicmap)
Returns the publication metadata as a Vector of sorted Occurrences, an empty Vector if none are available. |
String |
getScopedBaseName(Topic topic,
Topic[] scope)
Returns a base name String from the Topic topic, giving preference to one in the optional Topic[] scope. |
Occurrence |
getSelectedOccurrence(Topic topic,
boolean acceptAny)
Returns the selected occurrence of the provided Topic using the PSI Selected as indicator. |
String |
getSortName(Topic topic,
Topic[] scope)
Returns a String which may be used as a sort name in the specified scope. |
int |
getTemplateCount(TopicMap topicmap)
Returns the number of Association templates for the given TopicMap, from the cache. |
Association |
getTemplateForType(Topic type)
Returns the Association used as the template for the provided Topic if it matches any of the available Association Template typing Topics. |
String |
getTemplateLabel(Topic topic)
Returns an appropriate label (display name) for a Topic used as an association template. |
Set |
getTemplates(TopicMap topicmap)
Returns any "association templates" for TopicMap topicmap. |
Topic |
getTopicByID(TopicMap topicmap,
String id)
Return the Topic matching the ID id, null if it does not exist. |
Topic |
getTopicByName(TopicMap tm,
String label,
boolean create)
Returns a Topic with a base name in the XTM 'Display' scope of label, throwing a TopicMapException if unable to locate and/or create the Topic. |
TopicMap |
getTopicMap(Locator locator)
Returns the TopicMap specified by the Locator loc, null if no match is found. |
Collection |
getTopicMapBaseLocators()
Returns a Collection of the base locators of all TopicMap objects currently available from this TopicMapProcessor. |
Topic |
getTopicMapIdentifier(TopicMap topicmap)
Returns a Topic whose subject is its parent TopicMap. |
Collection |
getTopicMapProviders()
Returns the TopicMapProvider for the TopicMap topicmap as a Collection. |
Collection |
getTopicMaps()
Returns a Collection view of the TopicMap objects created by this TopicMapProcessor, an empty set (not null) if none exist. |
Set |
getTopicProperties(Topic topic,
String baseURI)
Returns all properties (i.e., Occurrences in the scope of the 'facet' PSI) of the supplied Topic topic having a type whose subject domain starts with the String baseURI. |
String |
getTopicProperty(Topic topic,
Topic type)
Returns a property of the supplied Topic topic as an Occurrence having a type. |
Collection |
getTopicsOfType(TopicMap tm,
Topic type)
Returns a Collection containing all Topics having the given type. |
BaseName |
hasLabel(Topic topic,
String label,
Set scope)
A check to see if the Topic already has the label. |
Occurrence |
hasOccurrence(Topic topic,
Topic type,
Locator locator)
Provided with a Topic topic, returns the Occurrence containing the Locator locator as a data locator (not inline). |
Occurrence |
hasOccurrence(Topic topic,
Topic type,
String data)
Provided with a Topic topic, returns the Occurrence containing the String data as a data locator (inline). |
static boolean |
hasSubject(Topic topic,
Locator subject)
Returns true if the supplied Topic topic has as one of its subject indicators the Locator subject. |
static boolean |
hasSubject(Topic topic,
String uri)
Returns true if the supplied Topic topic has as one of its subject indicators a Locator whose address is the URI uri. |
boolean |
hasTemplateForType(Topic type)
Returns true if the provided Topic matches any of the available Association Template typing Topics. |
boolean |
hasTopicMap(Locator locator)
Returns true if the provider contains a TopicMap with the base Locator locator. |
boolean |
isEditableType(Topic type)
Returns true if either the type is null, or it is not one of the standard, non-editable typing Topics. |
boolean |
isInSubjectDomain(Topic topic,
String baseURI)
Similar to hasSubject(), returns true if the Topic has a subject matching the base URI part of the supplied Locator. |
Locator |
isProvidedAs(TopicMap topicmap)
Checks to see if the TopicMap topicmap is provided by the provider, returning the Locator by which it is identified. |
boolean |
isProvidedTopicMap(Locator locator)
Returns true if the TopicMap having Locator locator is provided by the TopicMapProvider. |
boolean |
isProvidedTopicMap(TopicMap topicmap)
Returns true if the TopicMap topicmap is provided by the TopicMapProvider (comparing using object equality). |
boolean |
isSelected(Occurrence occur)
Returns true if the provided Occurrence is the selected occurrence of its parent Topic. |
boolean |
isTemplate(Association assoc)
Returns true if the provided Association assoc is an association template, that is, has a scope matching the PSI Template. |
boolean |
isUtilityOccurrence(Occurrence occur)
For lack of a better term, "utility" occurrences are those whose purpose is not meant to be seen (to the user) as an occurrence, such as the Topic color, location, or description. |
void |
listTemplates(TopicMap topicmap)
Prints the list of association templates for the TopicMap topicmap to System.err. |
void |
listTopicMaps()
Prints the current list of stored TopicMaps to the MessageHandler. |
void |
listTopics(String desc,
Collection c)
Prints the current list of Topics in the provided Collection to System.err, including the description String. |
TopicMap |
makeConsistent(TopicMap topicmap)
Calls the static XTMUtils method of the same name to process the provided TopicMap topicmap into a consistent topic map as according to the XTM 1.0 Specification. |
boolean |
matchesSubject(Topic topic,
Set topics)
Returns true if any of the subject identifiers of topic match any of the subject identifiers of any of the Topics in Set topics. |
boolean |
matchesTemplate(Topic type,
Topic fromRole,
Topic toRole)
Returns true if the provided parameters match an existing Association template (which must be in the scope of the PSI Template). |
void |
mergeTopicMap(TopicMap baseTM,
Locator mergeLocator)
Merges the Topic Map document located at Locator mergeLoc with the base Topic Map baseTM. |
Topic |
mergeTopics(Set topics)
Manually merges the Set of Topics, eliminating duplicate names, occurrences, and subject indicators, returning the merged Topic. |
TopicMapProvider |
registerProvider(String providerFactoryClassName,
Properties props)
Registers a new TopicMapProvider with the manager (unimplemented). |
TopicMapProvider |
registerProvider(String id,
String providerFactoryClassName,
Properties props)
Registers a new provider with the manager. |
boolean |
removeAssociation(Association assoc)
Removes Association assoc, returning true if successful. |
Set |
removeAssociationsOfType(TopicMap tm,
Topic type)
Remove all Associations having a type matching the Topic type, as well as the TG ANode and connected GraphEdges. |
boolean |
removeFacets(Topic faceted,
Topic type)
Removes any facets of the Topic faceted having typing Topic type. |
boolean |
removeName(Topic topic,
BaseName basename)
Remove the BaseName from the Topic, returning true if successful. |
boolean |
removeOccurrence(Topic topic,
Occurrence occur)
Removes Occurrence occur from Topic topic, returning true if successful. |
boolean |
removeTopic(Topic topic)
Removes Topic topic, returning true if successful. |
boolean |
removeTopicMap(Locator locator)
Permanently removes the TopicMap having the base locator locator from the provider. |
boolean |
removeType(Topic topic,
Topic type)
Remove the typing Topic from the Topic, returning true if successful. |
void |
reset()
Resets the TopicMapProcessor, removing any previously-processed TopicMap objects. |
Locator |
resolveEntity(Locator source)
Attempts to resolve the system identifier in the provided Locator source using the catalog resolver. |
void |
resolveMergeMaps(TopicMap baseTM)
Resolves any mergeMap directives in the provided TopicMap baseTM. |
Association |
returnAssociationWithID(TopicMap topicmap,
String id)
Returns either the existing Association whose ID is id, or a new Association if a matching one is not already available. |
Locator |
returnLocator(String uriref)
Returns a Locator whose address is uri. |
Locator |
returnLocator(TopicMap topicmap,
String uriref)
Returns a Locator whose address is uri. |
Topic |
returnTopicByID(TopicMap topicmap,
String id)
Returns either the existing Topic whose ID is id, or a new Topic if a matching one is not already available. |
Topic |
returnTopicByLocator(TopicMap topicmap,
String id,
Locator locator)
Returns a Topic having a subject defined by a PSI (a URI, in this case as a Locator), returning null if for some reason the Topic cannot be created. |
Topic |
returnTopicByURI(TopicMap topicmap,
String uri)
Returns a Topic having a subject defined by an ID or PSI (a URI), returning null if for some reason the Topic cannot be created. |
Topic |
returnTopicWithPSI(TopicMap topicmap,
String id,
String uri)
If a Topic having a subject matching the PSI exists, it is returned (note that the supplied ID is ignored in this case). |
Set |
searchOnLabel(TopicMap topicmap,
String searchString,
boolean strict,
boolean caseSensitive)
Search the TopicMap by label (display name), either as a strict or contains match. |
Occurrence |
setDescription(Topic topic,
String id,
String text)
Sets the textual description of the supplied Topic topic as an Occurrence whose type is the PSI http://purl.org/ceryle/psi/ceryle/#Description, with a required ID value id. |
BaseName |
setDisplayName(Topic topic,
String name,
Set scope)
A convenience method that sets a variant name String name on the provided Topic topic. |
BaseName |
setLabel(Topic topic,
String label)
A convenience method that calls setLabel(Topic,String,Set)
with a null Scope parameter. |
BaseName |
setLabel(Topic topic,
String label,
Set scope)
Sets a label for this Topic to the string label, as a Variant whose parameter (scope) is XTM 1.0's "display". |
Occurrence |
setOccurrence(Topic topic,
String id,
Object value,
Topic type,
Topic[] scope)
Sets an occurrence of the supplied Topic topic with an optional typing Topic type and optional Topic[] scope, with a required ID value id. |
void |
setSelected(Occurrence occur,
boolean selected)
When selected is true, sets the provided Occurrence as the selected Occurrence of its parent Topic, removing the "Selected PSI" theme from all other Occurrences of the Topic. |
Occurrence |
setTopicProperty(Topic topic,
Topic type,
String value)
Sets a property of the supplied Topic topic as an Occurrence having a type. |
boolean |
topicExists(TopicMap topicmap,
String id)
A convenience method that returns true if a Topic whose ID is id exists. |
Set |
traverse(Topic topic,
int direction,
int depth,
boolean taxonomic)
Traverses the parent TopicMap beginning with Topic topic, in the direction set by the int direction to a depth of depth. |
void |
writeTopicMap(TopicMap topicmap,
File file)
A convenience method that serializes the provided TopicMap object to the File file. |
void |
writeTopicMap(TopicMap topicmap,
OutputStream outputstream)
Serializes the provided TopicMap object to the OutputStream os. |
void |
writeTopicMap(TopicMap topicmap,
Writer writer)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_REFLEXIVE_TO
public static final int PROVIDER_MEMORY
public static final int PROVIDER_OZONE
public static final int PROVIDER_HIBERNATE
public static boolean exportResourceIDs
public static boolean exportImpliedIDs
public static String idPrefix
protected boolean useCeryleLTMProcessor
| Constructor Detail |
|---|
protected TopicMapProcessor(int backend)
throws TopicMapException
Allowed values include:
TopicMapServices.
TopicMapException - if unable to create the provider| Method Detail |
|---|
public String getID()
public Map getProviders()
public TopicMapProvider getProvider()
public TopicMapProvider getProvider(TopicMap topicmap)
This method is part of an implementation of the
TopicMapManager interface.
public boolean hasTopicMap(Locator locator)
throws TopicMapException
TopicMapExceptionpublic TopicMap getTopicMap(Locator locator)
This method is part of an implementation of the
TopicMapManager interface.
public TopicMap createTopicMap(Locator locator)
throws TopicMapException
TopicMapException - if the TopicMap already exists or can't be created.
public TopicMap createTopicMap(TypedInputSource source)
throws TopicMapException
NOTE: support for AsTMa= notation is not available in post 1.0alpha11 versions.
TopicMapException
public boolean removeTopicMap(Locator locator)
throws TopicMapException
TopicMapException
public Topic mergeTopics(Set topics)
throws TopicMapException
TopicMapExceptionpublic Locator resolveEntity(Locator source)
public void resolveMergeMaps(TopicMap baseTM)
throws TopicMapProviderException
TopicMapProviderException
public void mergeTopicMap(TopicMap baseTM,
Locator mergeLocator)
throws TopicMapProviderException
TopicMapProviderExceptionpublic Locator isProvidedAs(TopicMap topicmap)
public Topic getTopicByName(TopicMap tm,
String label,
boolean create)
throws TopicMapException
Note that this is not optimized as it does not use an index.
tm - the parent TopicMaplabel - the label of the returned Topiccreate - if true, the Topic will be created if it does not exist
TopicMapException - if unable to locate and/or create the Topic
IllegalStateException - if this method is called prior to creation of the TopicMap
public boolean removeTopic(Topic topic)
throws TopicMapException
TopicMapExceptionpublic Inferencer getInferencer()
Inferencer,
InferencerImplpublic static Topic[] convertScopeToArray(Set scope)
public static Set convertScopeToSet(Topic[] scope)
public static String getIdentifier(TopicMap topicmap)
public IDFactory getIDFactory()
public String generateID(TopicMap topicmap)
public String generateIDFromName(TopicMap topicmap,
String name)
public String generateID(TopicMap topicmap,
String prefix)
public String generateID()
public void reset()
public TopicLocatorPool getPool()
TopicLocatorPoolpublic PSIUtils getPSI()
TopicLocatorPoolpublic Collection getTopicMapBaseLocators()
This method is part of an implementation of the
TopicMapManager interface.
public Collection getTopicMapProviders()
This method is part of an implementation of the
TopicMapManager interface.
public Collection getTopicMaps()
This method is part of an implementation of the
TopicMapManager interface.
public TopicMapProvider registerProvider(String providerFactoryClassName,
Properties props)
throws TopicMapProviderException
This method is part of an implementation of the
TopicMapManager interface.
TopicMapProviderException
public TopicMapProvider registerProvider(String id,
String providerFactoryClassName,
Properties props)
throws TopicMapProviderException
TopicMapProviderException
public void deregisterProvider(String id)
throws TopicMapProviderException
TopicMapProviderException
public boolean removeName(Topic topic,
BaseName basename)
throws TopicMapException
TopicMapException
public Collection getTopicsOfType(TopicMap tm,
Topic type)
public boolean removeType(Topic topic,
Topic type)
throws TopicMapException
TopicMapException
public boolean addType(Topic topic,
Topic type)
throws TopicMapException
TopicMapException
public String getIDofTopicType(TopicMap tm,
Topic type)
public Topic returnTopicByID(TopicMap topicmap,
String id)
throws TopicMapException
topicmap - a reference to the topic map to be queriedid - the ID to be searched for
DuplicateObjectIDException - if the ID specifies an identifier already assigned to a non-Topic object
TopicMapException
public Topic returnTopicByLocator(TopicMap topicmap,
String id,
Locator locator)
public Topic returnTopicByURI(TopicMap topicmap,
String uri)
public Association returnAssociationWithID(TopicMap topicmap,
String id)
throws TopicMapException
topicmap - a reference to the topic map to be queriedid - the ID to be searched for
DuplicateObjectIDException - if the ID specifies an identifier already assigned to a non-Association object
TopicMapException
public Topic getTopicByID(TopicMap topicmap,
String id)
throws TopicMapException
id, null if it does not exist.
This is different than returnTopicByID(TopicMap,String), as it will return
null rather than create a new Topic.
If the provided String id is null, null is returned.
If the provided TopicMap topicmap is null, null is returned.
topicmap - a reference to the topic map to be queriedid - the ID identifier used as a query.
TopicMapException - if the node matching the ID is not a Topic object.
public Occurrence hasOccurrence(Topic topic,
Topic type,
Locator locator)
public Occurrence hasOccurrence(Topic topic,
Topic type,
String data)
public boolean topicExists(TopicMap topicmap,
String id)
public Set searchOnLabel(TopicMap topicmap,
String searchString,
boolean strict,
boolean caseSensitive)
public TopicMap makeConsistent(TopicMap topicmap)
XTMUtils
public static boolean hasSubject(Topic topic,
String uri)
public static boolean hasSubject(Topic topic,
Locator subject)
public boolean matchesSubject(Topic topic,
Set topics)
throws TopicMapException
TopicMapException
public boolean isInSubjectDomain(Topic topic,
String baseURI)
public BaseName setLabel(Topic topic,
String label)
throws TopicMapException
setLabel(Topic,String,Set)
with a null Scope parameter.
TopicMapException
public BaseName setLabel(Topic topic,
String label,
Set scope)
throws TopicMapException
NOTE: This first locates any existing base names having a "display" variant name, eliminates those base names, and sets this as the only one. This is necessarily ignoring scoping on the base name itself, and is a bit dangerous if the base name itself if valuable. The problem with only removing the variant is we end up with a bunch of basenames whose only purpose was to provide a display name.
If the Scope is specified, it will be added to the resulting basename. This also allows for multiple display names on the same Topic.
topic - the Topic on which to set the name/labellabel - the String used as the labelscope - an optional scope (as a Set of Topics) on the name/label
TopicMapException
public BaseName hasLabel(Topic topic,
String label,
Set scope)
throws TopicMapException
topic - the Topic to checklabel - the label to check forscope - the optional Scope of the BaseName; if present, it must match
TopicMapException - if anything goes wrong
public BaseName setDisplayName(Topic topic,
String name,
Set scope)
throws TopicMapException
TopicMapException
public String getDisplayName(Topic topic,
Topic[] scope)
public String getSortName(Topic topic,
Topic[] scope)
public String getLabel(Topic topic)
getLabel(Topic,Topic[])
with a null Scope parameter.
public String getLabel(Topic topic,
Topic[] scope)
getDisplayName(Topic,Topic[])public String getLabel(Association assoc)
public String getTemplateLabel(Topic topic)
public String getScopedBaseName(Topic topic,
Topic[] scope)
public Association createBinaryAssociation(Topic type,
Topic[] scope,
Topic role1,
Topic player1,
Topic role2,
Topic player2)
throws TopicMapException
TopicMapException
public Set removeAssociationsOfType(TopicMap tm,
Topic type)
public boolean removeAssociation(Association assoc)
public Association getBinaryAssociation(Topic type,
Topic topic1,
Topic topic2)
public Set getPlayersOfRoleInTypedAssociation(Topic topic,
Topic topicType,
Topic assocType,
Topic role,
Set set)
throws TopicMapException
topic - the provided Topic connected via associationstopicType - the optional type filter on acceptable TopicsassocType - the optional type filter on acceptable associationsrole - the role that the returned Topics must playset - the optionally-supplied Set container for the result
TopicMapException
public Topic createFacet(Topic faceted,
Topic[] facetScope,
Topic facetType,
Topic facetConstraint,
String facetValue)
throws TopicMapException
faceted - the Topic receiving the facet (required)facetScope - optional scope on facet associationfacetType - the class that the facet will be an instance of (required)facetConstraint - the facet constraint or occurrence type (optional; facetValue PSI assumed if null)facetValue - optional String value (if non-null, it is stored as the facet property 'facetValue')
TopicMapException - if any problems occur during facet creation
public boolean removeFacets(Topic faceted,
Topic type)
throws TopicMapException
faceted - the Topic to have the facet removedtype - the facet type to remove
TopicMapException
public Occurrence setDescription(Topic topic,
String id,
String text)
throws TopicMapException
This replaces any previous Occurrence used as a description. Any references to the previous description's resource ID may then be invalid. If the supplied ID value is null, removes any existing description. If the supplied ID value is null, a value will be supplied.
TopicMapException
public Occurrence setTopicProperty(Topic topic,
Topic type,
String value)
throws TopicMapException
The Scope used for this is derived from the Ceryle Facet PSI, considered as a monadic predicate, adding a simple 'facet' to the Topic occurrence.
TopicMapException
public String getTopicProperty(Topic topic,
Topic type)
throws TopicMapException
The Scope used for this is derived from the Ceryle Facet PSI, considered as a monadic predicate, adding a simple 'facet' to the Topic occurrence.
TopicMapException
public Set getTopicProperties(Topic topic,
String baseURI)
throws TopicMapException
The Scope used for this is derived from the Ceryle Facet PSI, considered as a monadic predicate, adding a simple 'facet' to the Topic occurrence.
TopicMapExceptionpublic boolean isSelected(Occurrence occur)
public void setSelected(Occurrence occur,
boolean selected)
throws TopicMapException
TopicMapException
public Occurrence getSelectedOccurrence(Topic topic,
boolean acceptAny)
throws TopicMapException
TopicMapException
public Occurrence setOccurrence(Topic topic,
String id,
Object value,
Topic type,
Topic[] scope)
throws TopicMapException
topic - the Topic receiving the new occurrenceid - the ID value of the occurrencevalue - the value of the occurrence, either a String or Locatortype - the optional type of the occurrencescope - the optional scope on the occurrence
TopicMapException
public Occurrence getOccurrenceOfType(Topic topic,
Topic type)
public String getDescription(Topic topic)
The returned string is whitespace normalized.
public Collection getOccurrences(Topic topic,
boolean ignoreDescription)
throws TopicMapException
TopicMapException
public int getOccurrenceCount(Topic topic,
boolean ignoreUtility)
public boolean isUtilityOccurrence(Occurrence occur)
throws TopicMapException
TopicMapException
public boolean removeOccurrence(Topic topic,
Occurrence occur)
throws TopicMapException
TopicMapException
public void writeTopicMap(TopicMap topicmap,
File file)
public void writeTopicMap(TopicMap topicmap,
OutputStream outputstream)
public void writeTopicMap(TopicMap topicmap,
Writer writer)
public Topic getAboutTopic(TopicMap topicmap,
boolean create)
throws TopicMapException
TopicMapException
public Vector getPublicationMetadata(TopicMap topicmap)
throws TopicMapException
TopicMapExceptionpublic void clearTemplates()
public boolean matchesTemplate(Topic type,
Topic fromRole,
Topic toRole)
type([fromRole] : PSIfrom, [toRole] : PSIto ) / Template
Note that reflexive relations have two 'To' role types (rather than
two 'From' role types.
public Topic[] getOrderedRolesForTemplate(Topic type)
If there isn't an Association template for the provided Topic, null is returned. For example, getOrderedRolesForTemplate(SuperclassSubclass) ("kind of") would return { Subclass, Superclass } in (subject,object) sentence order.
public boolean hasTemplateForType(Topic type)
public boolean isTemplate(Association assoc)
throws TopicMapException
TopicMapExceptionpublic Association getTemplateForType(Topic type)
public int getTemplateCount(TopicMap topicmap)
public Set getTemplates(TopicMap topicmap)
Since this method is often called repeatedly (e.g., during visualization), the TopicMaps used as parameters for this method are kept in a cache (a Hashtable) and returned using the TopicMap as a key.
The cache is cleared with clearTemplates().
topicmap - the TopicMap to query for templatespublic boolean isEditableType(Topic type)
public Set traverse(Topic topic,
int direction,
int depth,
boolean taxonomic)
The direction value may be Traverse.TRAVERSE_TO ("in the direction of graph arrows"), Traverse.TRAVERSE_FROM ("against the direction of graph arrows"), or TRAVERSE_ANY (ignoring direction).
topic - the starting point of the traversaldirection - traversal directiondepth - depth of traversal (in levels of Associations)taxonomic - for directed traversals, only traverse superclass-subclass relations
public Locator returnLocator(String uriref)
throws TopicMapException
Note that this method is unlike returnLocator(TopicMap,String)
in that the returned Locator is not associated with any TopicMap object.
uriref - the String used as the locator address
TopicMapException
public Locator returnLocator(TopicMap topicmap,
String uriref)
throws TopicMapException
This is a convenience method that calls
TopicLocatorPool.returnLocator(TopicMap,String).
topicmap - a reference to the topic map to be querieduriref - the String used as the locator address
TopicMapException
public Topic returnTopicWithPSI(TopicMap topicmap,
String id,
String uri)
throws TopicMapException
This is a convenience method that calls
TopicLocatorPool.returnTopicWithPSI(TopicMap,String,String).
topicmap - a reference to the topic map to be queriedid - the ID to be used for the new Topicuri - the String used as the locator address
TopicMapException
public Topic getTopicMapIdentifier(TopicMap topicmap)
throws TopicMapException
TopicMapExceptionpublic boolean isProvidedTopicMap(Locator locator)
public boolean isProvidedTopicMap(TopicMap topicmap)
public void listTopics(String desc,
Collection c)
public void listTopicMaps()
public void listTemplates(TopicMap topicmap)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||