com.apelon.dts.client.concept
Class BaseConceptQuery

java.lang.Object
  extended by com.apelon.apelonserver.client.BasicQuery
      extended by com.apelon.dts.client.attribute.QualifierTypeQuery
          extended by com.apelon.dts.client.attribute.PropertyTypeQuery
              extended by com.apelon.dts.client.concept.BaseConceptQuery
Direct Known Subclasses:
BaseLocalConceptQuery, BaseOntylogConceptQuery, DTSConceptQuery, SearchQuery

public abstract class BaseConceptQuery
extends PropertyTypeQuery

BaseConceptQuery is a base class for BaseLocalConceptQuery, BaseOntylogConceptQuery, DTSConceptQuery, and SearchQuery. Therefore it includes methods for both Ontylog and thesaurus concepts.

The following events are fired in this class:

Copyright: Copyright (c) 2007

Company: Apelon, Inc.

Since:
DTS 3.0.0
Version:
DTS 3.4.1
Author:
Apelon, Inc.

Field Summary
protected  ConceptListener conceptListener
           
 
Fields inherited from class com.apelon.dts.client.attribute.QualifierTypeQuery
kbtypeListener
 
Fields inherited from class com.apelon.apelonserver.client.BasicQuery
ADMIN, queryHeader
 
Method Summary
 void addConceptListener(ConceptListener listener)
           
 DTSConcept addProperty(DTSConcept concept, DTSProperty newProperty)
          Adds a property to a concept.
 boolean addSynonym(Synonym newSynonym)
          Adds a synonym association between a concept and a term.
 DTSConcept deleteProperty(DTSConcept concept, DTSProperty property)
          Deletes a property from a concept.
 boolean deleteSynonym(Synonym synonym)
          Deletes a synonym association between a concept and a term.
 DTSConcept findConceptByCode(String conceptCode, int namespaceId, ConceptAttributeSetDescriptor descriptor)
          Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept code, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
 DTSConcept findConceptById(int conceptId, int namespaceId, ConceptAttributeSetDescriptor descriptor)
          Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept ID, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
 DTSConcept findConceptByName(String conceptName, int namespaceId, ConceptAttributeSetDescriptor descriptor)
          Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept name, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
 DTSConcept[] findConceptsByCode(String[] conceptCodes, int[] namespaceIds, ConceptAttributeSetDescriptor descriptor)
          Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept codes, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
 DTSConcept[] findConceptsById(int[] conceptIds, int[] namespaceIds, ConceptAttributeSetDescriptor descriptor)
          Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept IDs, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
 DTSConcept[] findConceptsByName(String[] conceptNames, int[] namespaceIds, ConceptAttributeSetDescriptor descriptor)
          Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept names, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.
protected  void fireConceptAction(ConceptEvent event)
           
 DTSPropertyType[] getAllConceptPropertyTypes()
          Retrieves all concept property types.
 ConceptListener getConceptListener()
          Get the ConceptListener.
 DTSPropertyType[] getConceptPropertyTypes(int namespaceId)
          Retrieves all concept property types within a given namespace.
protected  NamespaceQuery getNamespaceQuery()
          Gets the internally used NamespaceQuery instance
 void removeConceptListener(ConceptListener listener)
           
 DTSConcept updateProperty(DTSConcept concept, DTSProperty oldProperty, DTSProperty newProperty)
          Updates the concept, replacing the old DTSProperty with the new DTSProperty including any qualifiers.
 boolean updateSynonym(Synonym oldSynonym, Synonym newSynonym)
          Updates a synonym association by passing old and new synonym associations.
 
Methods inherited from class com.apelon.dts.client.attribute.PropertyTypeQuery
addPropertyType, buildPropertyTypes, deletePropertyType, findPropertyTypeByCode, findPropertyTypeById, findPropertyTypeByName, isPropertyTypeUsed, updatePropertyType
 
Methods inherited from class com.apelon.dts.client.attribute.QualifierTypeQuery
addKBTypeListener, addQualifierType, deleteQualifierType, findQualifierTypeByCode, findQualifierTypeById, findQualifierTypeByName, fireKBTypeAction, getAllConceptAssociationQualifierTypes, getAllConceptPropertyQualifierTypes, getAllQualifierTypes, getAllTermAssociationQualifierTypes, getAllTermPropertyQualifierTypes, getConceptAssociationQualifierTypes, getConceptPropertyQualifierTypes, getKBTypeListener, getTermAssociationQualifierTypes, getTermPropertyQualifierTypes, removeKBTypeListener, updateQualifierType
 
Methods inherited from class com.apelon.apelonserver.client.BasicQuery
executeQuery, executeQueryNoParse, getServerConnection, initializeDtds, initializeDtds, ping, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conceptListener

protected transient ConceptListener conceptListener
Method Detail

getNamespaceQuery

protected NamespaceQuery getNamespaceQuery()
Gets the internally used NamespaceQuery instance

Returns:
NamespaceQuery for internal use to this query class

addProperty

public DTSConcept addProperty(DTSConcept concept,
                              DTSProperty newProperty)
                       throws DTSException
Adds a property to a concept. The property may be a qualified property. If the concept is in a local namespace, only the property which is in the same local namespace can be added to the concept. Otherwise a DTSException will be thrown.

Parameters:
concept - the concept to which a property will be added
newProperty - the property to add
Returns:
the original DTSConcept with the property added
Throws:
DTSException - if any error occurs in the method

deleteProperty

public DTSConcept deleteProperty(DTSConcept concept,
                                 DTSProperty property)
                          throws DTSException
Deletes a property from a concept.

Parameters:
concept - the concept from which a property will be deleted
property - the property to delete
Returns:
the original DTSConcept with the property deleted
Throws:
DTSException - if any error occurs in the method

updateProperty

public DTSConcept updateProperty(DTSConcept concept,
                                 DTSProperty oldProperty,
                                 DTSProperty newProperty)
                          throws DTSException
Updates the concept, replacing the old DTSProperty with the new DTSProperty including any qualifiers. If the new property includes qualifiers that were not on the old property, the qualifiers will be added. In turn, if the old property includes any qualifiers that are not part of the new property the old qualifiers will be removed.

Parameters:
concept - concept for which a property is to be updated
oldProperty - existing property to be updated
newProperty - DTSProperty having updated values
Returns:
the original DTSConcept with the property updated
Throws:
DTSException - if any error occurs in the method

findConceptByName

public DTSConcept findConceptByName(String conceptName,
                                    int namespaceId,
                                    ConceptAttributeSetDescriptor descriptor)
                             throws DTSException
Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept name, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptName - the name of the concept to get
namespaceId - ID of the concept's namespace
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
a concept object that corresponds to the argument concept name, with the specified attributes filled in
Throws:
DTSException - if any error occurs in the method

findConceptsByName

public DTSConcept[] findConceptsByName(String[] conceptNames,
                                       int[] namespaceIds,
                                       ConceptAttributeSetDescriptor descriptor)
                                throws DTSException
Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept names, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptNames - the array of names of concepts to get
namespaceIds - array of the concepts' namespace IDs
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
an array of concept objects that correspond to the argument concept names, with the specified attributes filled in
Throws:
DTSException - if any error occurs in the method

findConceptById

public DTSConcept findConceptById(int conceptId,
                                  int namespaceId,
                                  ConceptAttributeSetDescriptor descriptor)
                           throws DTSException
Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept ID, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptId - the ID of the concept to get
namespaceId - ID of the concept's namespace
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
a concept that is the same concept as the argument concept, except that the specified attributes are filled in
Throws:
DTSException - if any error occurs in the method

findConceptsById

public DTSConcept[] findConceptsById(int[] conceptIds,
                                     int[] namespaceIds,
                                     ConceptAttributeSetDescriptor descriptor)
                              throws DTSException
Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept IDs, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptIds - the array of IDs of concepts to get
namespaceIds - array of the concepts' namespace IDs
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
an array of concept objects that correspond to the argument concept IDs, with the specified attributes filled in
Throws:
DTSException - if any error occurs in the method

findConceptByCode

public DTSConcept findConceptByCode(String conceptCode,
                                    int namespaceId,
                                    ConceptAttributeSetDescriptor descriptor)
                             throws DTSException
Gets a concept object (DTSConcept or OntylogConcept) that represents the same concept as the argument concept code, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptCode - the code of the concept to get
namespaceId - ID of the concept's namespace
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
a concept that is the same concept as the argument concept, except that the specified attributes are filled in
Throws:
DTSException - if any error occurs in the method

findConceptsByCode

public DTSConcept[] findConceptsByCode(String[] conceptCodes,
                                       int[] namespaceIds,
                                       ConceptAttributeSetDescriptor descriptor)
                                throws DTSException
Gets an array of concept objects (DTSConcepts or OntylogConcepts) that represent the same concepts as the argument array of concept codes, from the same respective namespaces represented by the namespace ID array, but with those attributes present that are specified in the ConceptAttributeSetDescriptor.

Parameters:
conceptCodes - the array of codes of concepts to get
namespaceIds - array of the concepts' namespace IDs
descriptor - the ConceptAttributeSetDescriptor that specifies which attributes to fetch
Returns:
an array of concept objects that correspond to the argument concept codes, with the specified attributes filled in
Throws:
DTSException - if any error occurs in the method

getAllConceptPropertyTypes

public DTSPropertyType[] getAllConceptPropertyTypes()
                                             throws DTSException
Retrieves all concept property types.

Returns:
an array of all the concept DTSPropertyTypes. Returns an empty array if there are no concept DTSPropertyTypes.
Throws:
DTSException - if any error occurs in the method

getConceptPropertyTypes

public DTSPropertyType[] getConceptPropertyTypes(int namespaceId)
                                          throws DTSException
Retrieves all concept property types within a given namespace.

Parameters:
namespaceId - the ID of the namespace of interest
Returns:
an array of DTSPropertyTypes in the namespace. Returns an empty array if there are no concept DTSPropertyTypes.
Throws:
DTSException - if any error occurs in the method

addSynonym

public boolean addSynonym(Synonym newSynonym)
                   throws DTSException
Adds a synonym association between a concept and a term. If the preferred flag is set, and another synonym for the concept was previously set as the preferred term, that condition will be cleared.

Parameters:
newSynonym - Synonym to be added
Returns:
true if the synonym is added succesfully; otherwise false.
Throws:
DTSException - if any error occurs in the method

deleteSynonym

public boolean deleteSynonym(Synonym synonym)
                      throws DTSException
Deletes a synonym association between a concept and a term.

Parameters:
synonym - Synonym to be deleted
Returns:
true if the synonym is succesfully deleted; false otherwise.
Throws:
DTSException - if any error occurs in the method

updateSynonym

public boolean updateSynonym(Synonym oldSynonym,
                             Synonym newSynonym)
                      throws DTSException
Updates a synonym association by passing old and new synonym associations. The synonym concept, term, association type, or preferred status may be updated in the process. If the preferred flag is set in the new synonym, and another synonym for the new synonym concept was previously set as the preferred term, that condition will be cleared.

Parameters:
oldSynonym - the original synonym association
newSynonym - the updated synonym association
Returns:
true if the update is successful; false otherwise
Throws:
DTSException - if any error occurs in the method

getConceptListener

public ConceptListener getConceptListener()
Get the ConceptListener. This can be used to link the chain of concept listeners of this class to concept listener of another instance of Query extends from BaseConceptQuery.

Returns:
ConceptListener

addConceptListener

public void addConceptListener(ConceptListener listener)

removeConceptListener

public void removeConceptListener(ConceptListener listener)

fireConceptAction

protected void fireConceptAction(ConceptEvent event)


Copyright © 2011. All Rights Reserved.