jcreek.cke.importexport.jcxml
Class JCXMLexportParser

java.lang.Object
  extended byjcreek.cke.importexport.xml.DefaultGeneralParser
      extended byjcreek.cke.importexport.jcxml.JCXMLexportParser

public class JCXMLexportParser
extends DefaultGeneralParser

Does the parsing of the Creek Knowledge Model and extracts the complete model to JCXML.

Author:
Stein L. Tomassen, NTNU 2002

Field Summary
 
Fields inherited from class jcreek.cke.importexport.xml.DefaultGeneralParser
DEFFERED_DOM, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, SCHEMA_FULL_SUPPORT, SCHEMA_SUPPORT, VALIDATION
 
Constructor Summary
JCXMLexportParser(java.lang.String fileName, KnowledgeModel km, boolean abortOnFatalErrors, ProcessStatusWindowInterface statusWindow)
          Does set some basic settings before any parsing may begin.
 
Method Summary
protected  void createBasicDocument()
          Creates a basic document.
 boolean didFatalErrorOccur()
          Checks if an fatal error did occur.
protected  void handleAboutElement()
          Does the handling of the general information about the knowledge model.
protected  void handleCaseElement()
          Does the handling of the cases.
protected  void handleEntityElement()
          Does the handling of the entities (concepts) of the knowledge model.
protected  void handleNewRelationElement()
          Handels the relations that are an extension to the isopod model, that is new relations.
protected  void handleRelationElement()
          Does the handling of the relations among the entities.
 boolean isAbortOnFatalErrorsEnabled()
          Checks if abortOnFatalErrors is set or not.
 void startCreate()
          Starts the creation of the JCXML document.
 void writeToDisk()
          Writes the DOM document to disk.
 
Methods inherited from class jcreek.cke.importexport.xml.DefaultGeneralParser
anyFaults, getAllFaultMsg, getErrorsMsg, getFatalErrorsMsg, getNumberOfErrors, getNumberOfFatalErrors, getNumberOfWarnings, getWarningsMsg, initParser, parse, parse, parse, parse, setFeature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCXMLexportParser

public JCXMLexportParser(java.lang.String fileName,
                         KnowledgeModel km,
                         boolean abortOnFatalErrors,
                         ProcessStatusWindowInterface statusWindow)
Does set some basic settings before any parsing may begin.

Parameters:
fileName - the name and path of the output file
km - the Knowledge Model in Creek to export
abortOnFatalErrors - set to true if the export should be aborted in case of a fatal error, if not set to false
statusWindow - the window where the process status messages should be displayed
Method Detail

startCreate

public void startCreate()
Starts the creation of the JCXML document.


isAbortOnFatalErrorsEnabled

public boolean isAbortOnFatalErrorsEnabled()
Checks if abortOnFatalErrors is set or not.

Returns:
true if bortOnFatalErrors is enabled, otherwise false.

didFatalErrorOccur

public boolean didFatalErrorOccur()
Checks if an fatal error did occur.

Returns:
true if an fatal error did occur, otherwise false.

writeToDisk

public void writeToDisk()
Writes the DOM document to disk.


createBasicDocument

protected void createBasicDocument()
Creates a basic document. Must be run before trying to add any elements. Is run by the startCreate() method.


handleAboutElement

protected void handleAboutElement()
Does the handling of the general information about the knowledge model. Does only insert the data that is available, and that is basically the name of the model. Does also insert the date that this model was exported.


handleNewRelationElement

protected void handleNewRelationElement()
Handels the relations that are an extension to the isopod model, that is new relations. Only the new relations are added to the JCXML. If a value collected is not valid, i.e. strength is out of range or e.g. no description, then these fields are not added to the JCXML output.


handleEntityElement

protected void handleEntityElement()
Does the handling of the entities (concepts) of the knowledge model. If the entity has a description then that is added as well.


handleRelationElement

protected void handleRelationElement()
Does the handling of the relations among the entities. Does either add the normal-way or the inverse-way of the relation, not both. If the relation has a valid strength, then that value is added as well.

Does not add relations that are not directly connected between two entities.


handleCaseElement

protected void handleCaseElement()
Does the handling of the cases.

Does in the same process take care of the findings and the possible solution of the case as well. If the case doesn't have a solution then no solution will be added. A solution might either have as status 'solved' or 'unsolved'. If the case got a description then that is added as well. If the 'importance' or the 'predictiveStrength' values of the findings or the solution then these values are added as well.



Created at IDI, NTNU by the Artificial Intelligence and Learning group