com.apelon.dts.client.concept
Class SearchQuery

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
                  extended by com.apelon.dts.client.concept.SearchQuery

public abstract class SearchQuery
extends BaseConceptQuery

An SearchQuery provides search methods for searching thesaurus or Ontylog concepts. Some methods only apply to Ontylog concepts.

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

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

Field Summary
 
Fields inherited from class com.apelon.dts.client.concept.BaseConceptQuery
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
static SearchQuery createInstance(ServerConnection sc)
          Creates an instance of SearchQuery.
static SearchQuery createInstance(ServerConnection sc, boolean isValidating)
          Creates an instance of SearchQuery.
 OntylogConcept[] findConceptsWithConceptAssociationMatching(AssociationType conceptAssocType, String toConceptName, DTSSearchOptions options)
          Gets all concepts with associations of the specified type whose target concept name is matched, based on the specified search options.
 OntylogConcept[] findConceptsWithConceptAssociationMatching(AssociationType conceptAssocType, String toConceptName, int subsetId, int limit)
          Gets all concepts with associations of the specified type whose target concept name is matched, based on the subset id and the max match limit.
 OntylogConcept[] findConceptsWithInverseConceptAssociationMatching(AssociationType invConceptAssocType, String fromConceptName, DTSSearchOptions options)
          Gets all concepts in associations of the specified type whose source concept name is matched, based on the specified search options.
 OntylogConcept[] findConceptsWithInverseConceptAssociationMatching(AssociationType invConceptAssocType, String fromConceptName, int subsetId, int limit)
          Gets all concepts in associations of the specified type whose source concept name is matched, based on the subset provided.
 OntylogConcept[] findConceptsWithInverseRoleMatching(DTSRoleType roleType, String pattern, DTSSearchOptions options)
          Retrieves each concept which is a value of a DTSRole with a selected DTSRoleType, if the concept name having the role matches the argument pattern.
 OntylogConcept[] findConceptsWithInverseRoleMatching(DTSRoleType roleType, String pattern, int subsetId, int limit)
          Retrieves each concept which is a value of a DTSRole with a selected DTSRoleType in a subset (given by subset id), if the concept name having the role matches the argument pattern.
 OntylogConcept[] findConceptsWithNameMatching(String pattern, DTSSearchOptions options)
          Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified search options.
 OntylogConcept[] findConceptsWithNameMatching(String pattern, DTSSearchOptions options, boolean synonyms)
          Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified search options.
 OntylogConcept[] findConceptsWithNameMatching(String pattern, int subsetId, boolean synonyms, int limit)
          Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified subset id.
 OntylogConcept[] findConceptsWithPropertyContaining(DTSPropertyType propType, String pattern, DTSSearchOptions options)
          Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value contains the argument pattern.
 OntylogConcept[] findConceptsWithPropertyContaining(DTSPropertyType propType, String pattern, int subsetId, int limit)
          Retrieves each concept present in the subset with a selected DTSPropertyType, if the concept DTSPropertyType value contains the argument pattern.
 OntylogConcept[] findConceptsWithPropertyMatching(DTSPropertyType propType, String pattern, DTSSearchOptions options)
          Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value matches the argument pattern.
 OntylogConcept[] findConceptsWithPropertyMatching(DTSPropertyType propType, String pattern, int subsetId, int limit)
          Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value matches the argument pattern.
 OntylogConcept[] findConceptsWithRoleMatching(DTSRoleType roleType, String pattern, DTSSearchOptions options)
          Retrieves each concept with a selected DTSRoleType, if the concept DTSRoleType value matches the argument pattern.
 OntylogConcept[] findConceptsWithRoleMatching(DTSRoleType roleType, String pattern, int subsetId, int limit)
          Retrieves each concept in the given subset with a selected DTSRoleType, if the concept DTSRoleType value matches the argument pattern.
 OntylogConcept[] findConceptsWithSynonymMatching(AssociationType synonymType, String synonymTermName, DTSSearchOptions options)
          Gets all concepts with synonyms of the specified type matching the synonym name, based on the specified search options.
 OntylogConcept[] findConceptsWithSynonymMatching(AssociationType synonymType, String synonymTermName, int subsetId, int limit)
          Gets all concepts with synonyms of the specified type matching the synonym name, based on the subset provided.
 
Methods inherited from class com.apelon.dts.client.concept.BaseConceptQuery
addConceptListener, addProperty, addSynonym, deleteProperty, deleteSynonym, findConceptByCode, findConceptById, findConceptByName, findConceptsByCode, findConceptsById, findConceptsByName, fireConceptAction, getAllConceptPropertyTypes, getConceptListener, getConceptPropertyTypes, getNamespaceQuery, removeConceptListener, updateProperty, updateSynonym
 
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
 

Method Detail

createInstance

public static SearchQuery createInstance(ServerConnection sc)
                                  throws IllegalArgumentException
Creates an instance of SearchQuery. Depending on the type of ServerConnection object passed in the argument, the server may be local (JDBC), socket, or another implementation. When using a socket connection, the Apelon DTS server must be configured with the following query servers to support SearchQuery: If you're using a JDBC connection, you'll need to add something like the following lines:
  ServerConnectionJDBC scJDBC = new ServerConnectionJDBC(user, password,
    host, port, instance);
  SearchQuery searchQuery = SearchQuery.createInstance(scJDBC);
  scJDBC.setQueryServer(com.apelon.dts.server.SearchQueryServer.class,
    DTSHeader.SEARCHSERVER_HEADER);
  scJDBC.setQueryServer(com.apelon.dts.server.OntylogConceptServer.class,
    DTSHeader.ONTYLOGCONCEPTSERVER_HEADER);
 

Parameters:
sc - the server connection
Returns:
the created SearchQuery
Throws:
IllegalArgumentException - if a null server connection is passed
See Also:
ServerConnectionJDBC, ServerConnectionSocket, ServerConnectionSecureSocket

createInstance

public static SearchQuery createInstance(ServerConnection sc,
                                         boolean isValidating)
                                  throws IllegalArgumentException
Creates an instance of SearchQuery. Depending on the type of ServerConnection object passed in the first argument, the server may be local (JDBC), socket, or another implementation. The second argument is a boolean value for XML validation. When using a socket connection, the Apelon DTS server must be configured with the following query servers to support SearchQuery: If you're using a JDBC connection, you'll need to add something like the following lines:
  ServerConnectionJDBC scJDBC = new ServerConnectionJDBC(user, password,
    host, port, instance);
  SearchQuery searchQuery = SearchQuery.createInstance(scJDBC, true);
  scJDBC.setQueryServer(com.apelon.dts.server.SearchQueryServer.class,
    DTSHeader.SEARCHSERVER_HEADER);
  scJDBC.setQueryServer(com.apelon.dts.server.OntylogConceptServer.class,
    DTSHeader.ONTYLOGCONCEPTSERVER_HEADER);
 

Parameters:
sc - the server connection
isValidating - true if XML needs to be validated, false otherwise.
Returns:
the created SearchQuery
Throws:
IllegalArgumentException - if a null server connection is passed
See Also:
ServerConnectionJDBC, ServerConnectionSocket, ServerConnectionSecureSocket

findConceptsWithNameMatching

public OntylogConcept[] findConceptsWithNameMatching(String pattern,
                                                     DTSSearchOptions options)
                                              throws DTSException
Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified search options. Searches only concept names.

Parameters:
pattern - the concept name pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of OntylogConcept objects with names that match the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method

findConceptsWithNameMatching

public OntylogConcept[] findConceptsWithNameMatching(String pattern,
                                                     DTSSearchOptions options,
                                                     boolean synonyms)
                                              throws DTSException
Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified search options. When the synonym parameter is set to true, searches both on synonym names and concept names.

Parameters:
pattern - the concept name pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
synonyms - if true searches by synonym name and concept name.
Returns:
an array of OntylogConcept objects with names that match the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method

findConceptsWithNameMatching

public OntylogConcept[] findConceptsWithNameMatching(String pattern,
                                                     int subsetId,
                                                     boolean synonyms,
                                                     int limit)
                                              throws DTSException
Retrieves each concepts with a name (string identifier) that matches the argument pattern, based on the specified subset id. Searches only concept names.

Parameters:
pattern - the concept name pattern for searching
subsetId - the subsetId in which the search is to be done
synonyms - if true searches by synonym name alongwith concept name.
limit - the maximum limit on the number of concepts retreived
Returns:
an array of OntylogConcept objects with names that match the concepts in the given subset. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0

findConceptsWithPropertyMatching

public OntylogConcept[] findConceptsWithPropertyMatching(DTSPropertyType propType,
                                                         String pattern,
                                                         DTSSearchOptions options)
                                                  throws DTSException
Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value matches the argument pattern. DTSPropertyType of size PropertyValueSize.INDEXABLE and PropertyValueSize.SEARCHABLE are supported only.

Parameters:
propType - each returned concept should have this DTSPropertyType.
pattern - the concept property value pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of concept objects with a property value that matches the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method

findConceptsWithPropertyMatching

public OntylogConcept[] findConceptsWithPropertyMatching(DTSPropertyType propType,
                                                         String pattern,
                                                         int subsetId,
                                                         int limit)
                                                  throws DTSException
Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value matches the argument pattern. DTSPropertyType of size PropertyValueSize.INDEXABLE and PropertyValueSize.SEARCHABLE are supported only.

Parameters:
propType - each returned concept should have this DTSPropertyType.
pattern - the concept property value pattern for searching
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of concept objects with a property value that matches the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method or if the DTSPropertyType is of size BIG ( PropertyValueSize )
Since:
3.4.0

findConceptsWithPropertyContaining

public OntylogConcept[] findConceptsWithPropertyContaining(DTSPropertyType propType,
                                                           String pattern,
                                                           DTSSearchOptions options)
                                                    throws DTSException
Retrieves each concept with a selected DTSPropertyType, if the concept DTSPropertyType value contains the argument pattern. DTSPropertyType of size PropertyValueSize.INDEXABLE and PropertyValueSize.SEARCHABLE are supported only.

Parameters:
propType - each returned concept should have this DTSPropertyType.
pattern - the concept property value pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of concept objects with a property value that contains the search pattern. An empty array is returned when there are no property values that contain the pattern.
Throws:
DTSException - if any error occurs in the method

findConceptsWithPropertyContaining

public OntylogConcept[] findConceptsWithPropertyContaining(DTSPropertyType propType,
                                                           String pattern,
                                                           int subsetId,
                                                           int limit)
                                                    throws DTSException
Retrieves each concept present in the subset with a selected DTSPropertyType, if the concept DTSPropertyType value contains the argument pattern.

Parameters:
propType - each returned concept should have this DTSPropertyType.
pattern - the concept property value pattern for searching
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of concept objects in the given subset with a property value that contains the search pattern. An empty array is returned when there are no property values that contain the pattern.
Throws:
DTSException - if any error occurs in the method
Since:
DTS 3.4.0

findConceptsWithRoleMatching

public OntylogConcept[] findConceptsWithRoleMatching(DTSRoleType roleType,
                                                     String pattern,
                                                     DTSSearchOptions options)
                                              throws DTSException
Retrieves each concept with a selected DTSRoleType, if the concept DTSRoleType value matches the argument pattern.

Parameters:
roleType - Each returned concept should have a DTSRole with this DTSRoleType.
pattern - the concept role value pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of concept objects with a role value that matches the pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method

findConceptsWithRoleMatching

public OntylogConcept[] findConceptsWithRoleMatching(DTSRoleType roleType,
                                                     String pattern,
                                                     int subsetId,
                                                     int limit)
                                              throws DTSException
Retrieves each concept in the given subset with a selected DTSRoleType, if the concept DTSRoleType value matches the argument pattern.

Parameters:
roleType - Each returned concept should have a DTSRole with this DTSRoleType.
pattern - the concept role value pattern for searching
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of concept objects with a role value that matches the pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0

findConceptsWithInverseRoleMatching

public OntylogConcept[] findConceptsWithInverseRoleMatching(DTSRoleType roleType,
                                                            String pattern,
                                                            DTSSearchOptions options)
                                                     throws DTSException
Retrieves each concept which is a value of a DTSRole with a selected DTSRoleType, if the concept name having the role matches the argument pattern.

Parameters:
roleType - Each returned concept should be a value of a DTSRole having this DTSRoleType.
pattern - the concept name pattern for searching
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of concept objects which are the value of a role of the specified DTSRoleType, and the concept name having the role matches the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method

findConceptsWithInverseRoleMatching

public OntylogConcept[] findConceptsWithInverseRoleMatching(DTSRoleType roleType,
                                                            String pattern,
                                                            int subsetId,
                                                            int limit)
                                                     throws DTSException
Retrieves each concept which is a value of a DTSRole with a selected DTSRoleType in a subset (given by subset id), if the concept name having the role matches the argument pattern.

Parameters:
roleType - Each returned concept should be a value of a DTSRole having this DTSRoleType.
pattern - the concept name pattern for searching
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of concept objects which are the value of a role of the specified DTSRoleType, and the concept name having the role matches the search pattern. An empty array is returned when there are no matches.
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0

findConceptsWithConceptAssociationMatching

public OntylogConcept[] findConceptsWithConceptAssociationMatching(AssociationType conceptAssocType,
                                                                   String toConceptName,
                                                                   DTSSearchOptions options)
                                                            throws DTSException
Gets all concepts with associations of the specified type whose target concept name is matched, based on the specified search options.

Parameters:
conceptAssocType - concept association type to search for
toConceptName - the to concept name
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of from OntylogConcepts with an association of the specified type where the to concept matches the passed concept name
Throws:
DTSException - if any error occurs in the method

findConceptsWithConceptAssociationMatching

public OntylogConcept[] findConceptsWithConceptAssociationMatching(AssociationType conceptAssocType,
                                                                   String toConceptName,
                                                                   int subsetId,
                                                                   int limit)
                                                            throws DTSException
Gets all concepts with associations of the specified type whose target concept name is matched, based on the subset id and the max match limit.

Parameters:
conceptAssocType - concept association type to search for
toConceptName - the to concept name
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of from OntylogConcepts with an association of the specified type where the to concept matches the passed concept name
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0

findConceptsWithInverseConceptAssociationMatching

public OntylogConcept[] findConceptsWithInverseConceptAssociationMatching(AssociationType invConceptAssocType,
                                                                          String fromConceptName,
                                                                          DTSSearchOptions options)
                                                                   throws DTSException
Gets all concepts in associations of the specified type whose source concept name is matched, based on the specified search options.

Parameters:
invConceptAssocType - concept association type to search for
fromConceptName - the from concept name
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of to OntylogConcepts in an association of the specified type where the from concept matches the passed concept name
Throws:
DTSException - if any error occurs in the method

findConceptsWithInverseConceptAssociationMatching

public OntylogConcept[] findConceptsWithInverseConceptAssociationMatching(AssociationType invConceptAssocType,
                                                                          String fromConceptName,
                                                                          int subsetId,
                                                                          int limit)
                                                                   throws DTSException
Gets all concepts in associations of the specified type whose source concept name is matched, based on the subset provided.

Parameters:
invConceptAssocType - concept association type to search for
fromConceptName - the from concept name
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of to OntylogConcepts in an association of the specified type where the from concept matches the passed concept name
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0

findConceptsWithSynonymMatching

public OntylogConcept[] findConceptsWithSynonymMatching(AssociationType synonymType,
                                                        String synonymTermName,
                                                        DTSSearchOptions options)
                                                 throws DTSException
Gets all concepts with synonyms of the specified type matching the synonym name, based on the specified search options.

Parameters:
synonymType - synonym type to search for
synonymTermName - the synonym name
options - DTS search options such as search limit, namespace to search in, attributes to return with retrieved concepts
Returns:
an array of OntylogConcepts with a synonym of the specified type where the synonym name matches the passed string
Throws:
DTSException - if any error occurs in the method

findConceptsWithSynonymMatching

public OntylogConcept[] findConceptsWithSynonymMatching(AssociationType synonymType,
                                                        String synonymTermName,
                                                        int subsetId,
                                                        int limit)
                                                 throws DTSException
Gets all concepts with synonyms of the specified type matching the synonym name, based on the subset provided.

Parameters:
synonymType - synonym type to search for
synonymTermName - the synonym name
subsetId - the subset id
limit - number of maximum concept matches to be retreived
Returns:
an array of OntylogConcepts with a synonym of the specified type where the synonym name matches the passed string
Throws:
DTSException - if any error occurs in the method
Since:
3.4.0


Copyright © 2011. All Rights Reserved.