com.apelon.dts.client.concept
Class OntylogExtConceptQuery

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

public abstract class OntylogExtConceptQuery
extends BaseLocalConceptQuery

OntylogExtConceptQuery is a subclass of BaseLocalConceptQuery. It can be instantiated to invoke the methods in BaseLocalConceptQuery, which operate on both Ontylog and Thesaurus concepts, by using methods createInstance(com.apelon.apelonserver.client.ServerConnection sc) or createInstance(com.apelon.apelonserver.client.ServerConnection sc, boolean isValidating). Ontylog concepts reside in a standard terminology namespace, provided by subscription from Apelon, or loaded from a TDE or existing DTS 2.4 database. Concepts in an Ontylog namespace cannot be added or deleted using DTS (TDE must be used for this purpose), but properties and synonyms of concepts may be added, deleted, or modified. Concepts can be added in an Ontylog Extension namespace (as it extends the BaseLocalConceptQuery) just as in the case of Thesaurus namespaces. The concepts in Ontylog Extension namespace can have defining concepts, roles from any Ontylog namespace. Also roles for an Ontylog Extension concepts can be grouped or ungrouped and the concept status can be updated to be either primitive or defined.

The following events are fired in this class:

If you have two instances of OntylogExtConceptQuery and you would like to share the listeners between them, then you can code something like this.
 OntylogExtConceptQuery oecq1 = null;
 OntylogExtConceptQuery oecq2 = null;

 // Initialization code for oecq1 and oecq2

 oecq2.addConceptListener(oecq1.getConceptListener());
 // Now any event from oecq2 will be available to oecq1 listeners
 

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

Since:
DTS 3.3.0
Version:
DTS 3.3.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
 boolean addDefiningConcept(OntylogConcept concept, OntylogConcept definingConcept)
          Adds an Ontylog concept as the defining concept to the Ontylog Extension Concept
 boolean addDefiningRole(OntylogConcept concept, DTSRole role)
          Adds a defining role to the given ontylog extension concept
static OntylogExtConceptQuery createInstance(ServerConnection sc)
          Creates an instance of OntylogExtConceptQuery.
static OntylogExtConceptQuery createInstance(ServerConnection sc, boolean isValidating)
          Creates an instance of OntylogExtConceptQuery.
 int createRoleGroup(OntylogConcept concept, DTSRole[] roles)
          Create a role group with the passed array of roles and returns the role group number.
 boolean deleteDefiningConcept(OntylogConcept concept, OntylogConcept definingConcept)
          Removes an Ontylog Concept as the defining concept from a given Ontylog Extension concept
 boolean deleteDefiningRole(OntylogConcept concept, DTSRole role)
          Deletes a defining role from the given ontylog extension concept
 void ungroupRoleGroup(OntylogConcept concept, int roleGroupNum)
          Disband a role group so that all included roles become ungrouped.
 boolean updateDefiningConcept(OntylogConcept concept, OntylogConcept deleteDefiningConcept, OntylogConcept addDefiningConcept)
          Updates an Ontylog Extension Concept by deleting the given defining concept and adding another defining concept to it.
 boolean updateDefiningRole(OntylogConcept concept, DTSRole deleteRole, DTSRole addRole)
          Updates an ontylog extension concept with a new defining role by removing its other existing defining role.
 boolean updatePrimitive(OntylogConcept concept, boolean primitive)
          Changes the given Ontylog Extension concept from primitive to defined or vice versa.
 
Methods inherited from class com.apelon.dts.client.concept.BaseLocalConceptQuery
addConcept, addConcept, deleteConcept, updateConcept, updateConcept
 
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 OntylogExtConceptQuery createInstance(ServerConnection sc)
                                             throws IllegalArgumentException
Creates an instance of OntylogExtConceptQuery. 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 server to support OntylogExtConceptQuery: 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);
  OntylogExtConceptQuery ontylogExtConceptQuery =
    OntylogExtConceptQuery.createInstance(scJDBC);
      sc.setQueryServer(Class.forName("com.apelon.dts.server.OntylogExtConceptServer"),
     DTSHeader.ONTYLOGEXTCONCEPTSERVER_HEADER);

 

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

createInstance

public static OntylogExtConceptQuery createInstance(ServerConnection sc,
                                                    boolean isValidating)
                                             throws IllegalArgumentException
Creates an instance of OntylogExtConceptQuery. 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 server to support OntylogExtConceptQuery: 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);
  OntylogExtConceptQuery ontylogExtConceptQuery =
    OntylogExtConceptQuery.createInstance(scJDBC);
      sc.setQueryServer(Class.forName("com.apelon.dts.server.OntylogExtConceptServer"),
     DTSHeader.ONTYLOGEXTCONCEPTSERVER_HEADER);
 

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

updatePrimitive

public boolean updatePrimitive(OntylogConcept concept,
                               boolean primitive)
                        throws DTSException
Changes the given Ontylog Extension concept from primitive to defined or vice versa. If the primitive parameter is true, the concept is changed to primitive if it was defined. If the primitive parameter is false, the concept is changed to defined if it was primitive.

Parameters:
concept - The Ontylog Extension Concept to modify
primitive - If true then make the concept defined, other wise make is primitive
Returns:
true if the original OntylogConcept changed to primitive from defined or vice versa
Throws:
IllegalArgumentException - if a null concept is passed
DTSException - if any error occurs in the method

addDefiningConcept

public boolean addDefiningConcept(OntylogConcept concept,
                                  OntylogConcept definingConcept)
                           throws DTSException,
                                  DTSValidationException
Adds an Ontylog concept as the defining concept to the Ontylog Extension Concept

Parameters:
concept - The Ontylog Extension Concept to be modified
definingConcept - The Ontylog Concept to be added as defining concept
Returns:
true if the original OntylogConcept is updated with the new defining concept
Throws:
IllegalArgumentException - if null concept arguments are passed
DTSValidationException - when a concept is added as a defining concept to itself
DTSException - for any other error

deleteDefiningConcept

public boolean deleteDefiningConcept(OntylogConcept concept,
                                     OntylogConcept definingConcept)
                              throws DTSException,
                                     DTSValidationException
Removes an Ontylog Concept as the defining concept from a given Ontylog Extension concept

Parameters:
concept - The Ontylog Extension Concept to be modified
definingConcept - The Ontylog Concept to be removed as defining concept
Returns:
true if the ontylog concept is removed as defining concept from original ontylog extension OntylogConcept
Throws:
IllegalArgumentException - if null concept arguments are passed
DTSValidationException - if the concept doesn't contain the defining concept
DTSException - for any other error

updateDefiningConcept

public boolean updateDefiningConcept(OntylogConcept concept,
                                     OntylogConcept deleteDefiningConcept,
                                     OntylogConcept addDefiningConcept)
                              throws DTSException,
                                     DTSValidationException
Updates an Ontylog Extension Concept by deleting the given defining concept and adding another defining concept to it.

Parameters:
concept - The Ontylog Extension Concept to be modified
deleteDefiningConcept - The Ontylog Concept to be removed as defining concept
addDefiningConcept - The Ontylog Concept to be added as defining concept
Returns:
true if the original OntylogConcept is updated with the new defining concept
Throws:
IllegalArgumentException - if null concept arguments are passed
DTSValidationException - when a concept itself is added as a defining concept or if invalid concept is added to it or non-existent defining concept is required to be removed from the Ontylog Extension concept.
DTSException - for any other error

addDefiningRole

public boolean addDefiningRole(OntylogConcept concept,
                               DTSRole role)
                        throws DTSException,
                               DTSValidationException
Adds a defining role to the given ontylog extension concept

Parameters:
concept - the ontylog extension concept to be modified
role - the role to be added to the above concept
Returns:
true if the role was successfully added
Throws:
IllegalArgumentException - if a null concept or role is passed
DTSValidationException - when the concept itself is added as the role value concept
DTSException - for any other error

deleteDefiningRole

public boolean deleteDefiningRole(OntylogConcept concept,
                                  DTSRole role)
                           throws DTSException,
                                  DTSValidationException
Deletes a defining role from the given ontylog extension concept

Parameters:
concept - the ontylog extension concept to be modified
role - the role to be removed from the above concept
Returns:
true if the role was successfully removed
Throws:
IllegalArgumentException - if a null concept or role is passed.
DTSValidationException - if the concept doesn't contain the defining role
DTSException - for any other error

updateDefiningRole

public boolean updateDefiningRole(OntylogConcept concept,
                                  DTSRole deleteRole,
                                  DTSRole addRole)
                           throws DTSException,
                                  DTSValidationException
Updates an ontylog extension concept with a new defining role by removing its other existing defining role.

Parameters:
concept - the ontylog extension concept to be modified
deleteRole - the role to be deleted from the above concept
addRole - the role to be added to the above concept
Returns:
true if the role was successfully added
Throws:
IllegalArgumentException - if a null concept or role is passed.
DTSValidationException - when the concept itself is added as the role value concept
DTSException - for any other error

createRoleGroup

public int createRoleGroup(OntylogConcept concept,
                           DTSRole[] roles)
                    throws DTSException,
                           DTSValidationException
Create a role group with the passed array of roles and returns the role group number. The roles passed should not be in any existing group.

Parameters:
concept - concept for which the role group is to be created
roles - array of roles to include in the new role group
Returns:
the new role group number, -1 if no roles are supplied
Throws:
IllegalArgumentException - if any argument is null.
DTSValidationException - if any role is already in another role group.
DTSException - if any other error occurs in the method.
Since:
DTS3.3

ungroupRoleGroup

public void ungroupRoleGroup(OntylogConcept concept,
                             int roleGroupNum)
                      throws DTSException
Disband a role group so that all included roles become ungrouped.

Parameters:
concept - a concept containing the role group to be ungrouped
roleGroupNum - the number of the role group to be ungrouped
Throws:
IllegalArgumentException - if the concept argument is null, or if invalid role group number is passed (must be 1 or greater).
DTSException - if any other error occurs in the method.
Since:
DTS3.3


Copyright © 2011. All Rights Reserved.