|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apelon.apelonserver.client.BasicQuery com.apelon.dts.client.classifier.ClassifyQuery
public abstract class ClassifyQuery
This class can be used to perform the classification of an Ontylog Extension namespace.
In order to classify an Ontylog Extension namespace, the concepts must adhere
to these rules:
The following modeling error conditions are identified during the classification process:
Once the classification is done successfully, the classification graph( inferred concepts and inferred roles) is refreshed for the Ontylog Extension namespace.
ClassifyQuery can take serveral types of ServerConnection. If the serverconnection is JDBC connection, the location of RTC connection parameter properties needs to be passed. 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); ClassifyQuery classifyQuery = ClassifyQuery.createInstance(scJDBC); String mcPath = "mc.properties"; //path is relative to the working directory scJDBC.setQueryServer( Class.forName("com.apelon.dts.server.ClassifyServer"), com.apelon.dts.client.common.DTSHeader.CLASSIFYQUERY_HEADER, new String[]{mcPath});The following events are fired in this class:
ClassifyEvent
is fired when starting classify, classify success, or classify fail
ClassifyQuery cq1 = null; ClassifyQuery cq2 = null; // Initialization code for cq1 and cq2 cq2.addClassifyListener(cq1.getClassifyListener()); // Now any event from cq2 will be available to cq1 listeners
Copyright: Copyright (c) 2003
Company: Apelon, Inc.
Field Summary | |
---|---|
protected ClassifyListener |
classifyListener
|
Fields inherited from class com.apelon.apelonserver.client.BasicQuery |
---|
ADMIN, queryHeader |
Constructor Summary | |
---|---|
protected |
ClassifyQuery()
Creates an instance of ClassifyQuery. |
protected |
ClassifyQuery(boolean isValidating)
Constructs a new ClassifyQuery. |
Method Summary | |
---|---|
void |
addClassifyListener(ClassifyListener listener)
|
boolean |
classify(int namespaceId)
Sends classification request to Modular Classifier server to classify the given Ontylog Extension local namespace with respect to the linked Ontylog Subscription namespace. |
static ClassifyQuery |
createInstance(ServerConnection sc)
Creates an instance of ClassifyQuery Depending on the type of ServerConnection object passed in the argument, the query may be local(JDBC), socket, or another implementation. |
static ClassifyQuery |
createInstance(ServerConnection sc,
boolean isValidating)
Creates an instance of ClassifyQuery. |
protected void |
fireClassifyAction(ClassifyEvent event)
|
ClassifyListener |
getClassifyListener()
Get the ClassifyListener. |
static boolean |
isCycleError(DTSException de)
During the classification, if an exception is thrown, this method can tell if the exception is due to the cycle error. |
static boolean |
isEqError(DTSException de)
During the classification, if an exception is thrown, this method can tell if the exception is due to the eq error. |
void |
removeClassifyListener(ClassifyListener listener)
|
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 |
---|
protected transient ClassifyListener classifyListener
Constructor Detail |
---|
protected ClassifyQuery()
protected ClassifyQuery(boolean isValidating)
isValidating
- a boolean value. It is true
if
XML needs to be validated, otherwise it is
false
.Method Detail |
---|
public static ClassifyQuery createInstance(ServerConnection sc) throws IllegalArgumentException
sc
- the type of server connection
IllegalArgumentException
- if a null server connection is passedServerConnectionJDBC
,
ServerConnectionSocket
public static ClassifyQuery createInstance(ServerConnection sc, boolean isValidating) throws IllegalArgumentException
sc
- the type of server connectionisValidating
- true
if XML needs to
be validated; otherwise it is false
.
IllegalArgumentException
- if a null server connection is passedServerConnectionJDBC
,
ServerConnectionSocket
public boolean classify(int namespaceId) throws DTSException
The classification process checks these conditions for the concepts of the namespace :
The classification process also throws DTSException for these modeling errors:
ClassifyCycleError
); Use
isCycleError(com.apelon.dts.client.DTSException)
to check whether the
DTSException is due to this error.
ClassifyEquivError
); Use
isEqError(com.apelon.dts.client.DTSException)
to check whether the
DTSException is due to this error.
There is a limitation of number of concepts to be classified. The default maximum number of concepts to be classified is 1,0000,000. If the number of concepts in the Ontylog Extension namespace is more than this limit, the API will throw DTSException.
namespaceId
- Ontylog Extension namespace id
true
- the classification is done successfully;
otherwise false
.
DTSException
- if any error occurs in the methodClassifyDetailsQuery
public static boolean isCycleError(DTSException de)
de
- DTSException thrown from classify API
true
- indicates the error is due to cycle error;
otherwise false
.ClassifyCycleError
public static boolean isEqError(DTSException de)
de
- DTSException thrown from classify API
true
- indicates the error is due to equivalency error;
otherwise false
.ClassifyEquivError
protected void fireClassifyAction(ClassifyEvent event)
public ClassifyListener getClassifyListener()
public void addClassifyListener(ClassifyListener listener)
public void removeClassifyListener(ClassifyListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |