org.put.semintec.utils
Class IOUtils

java.lang.Object
  extended by org.put.semintec.utils.IOUtils

public class IOUtils
extends java.lang.Object

Provides methods that perform I/O operations.

Author:
Agnieszka Lawrynowicz

Constructor Summary
IOUtils()
           
 
Method Summary
 java.util.ArrayList readPatternList(java.lang.String fileName, org.semanticweb.kaon2.api.logic.Variable keyVar)
          Reads a list of patterns (conjunctive queries) from file
 java.util.HashMap readXMLSetupFile(java.lang.String fileName)
          Reads input arguments for the mining application, stored in XML file
 void savePatterns(java.util.HashMap params, Trie trie, java.lang.String fileName)
          Saves patterns, discovered during data mining execution, into specified file
 void saveRules(java.util.HashMap params, java.util.ArrayList rules, java.lang.String fileName)
          Saves rules, generated from discovered patterns, into specified file
 void saveStatistics(java.util.HashMap params, Statistics statistics, java.lang.String fileName)
          Saves statistics about data mining execution into specified file
 void saveToGraphML(jdsl.core.api.Tree taxonomy, java.lang.String fileName, java.lang.String[] params)
          Writes a given taxonomy of predicates or nodes to specified file in GraphML format.
 void saveToGraphML(Trie trie, java.lang.String fileName, java.lang.String[] params)
          Writes a given trie data structure to specified file in GraphML format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

saveStatistics

public void saveStatistics(java.util.HashMap params,
                           Statistics statistics,
                           java.lang.String fileName)
Saves statistics about data mining execution into specified file

Parameters:
params - Parameters of data mining execution
statistics - Collected statistics
fileName - Name of the file to write statistics (with path)

savePatterns

public void savePatterns(java.util.HashMap params,
                         Trie trie,
                         java.lang.String fileName)
Saves patterns, discovered during data mining execution, into specified file

Parameters:
params - Parameters of data mining execution
trie - Trie structure that stores frequent patterns
fileName - Name of the file to write statistics (with path)

saveRules

public void saveRules(java.util.HashMap params,
                      java.util.ArrayList rules,
                      java.lang.String fileName)
Saves rules, generated from discovered patterns, into specified file

Parameters:
params - Parameters of data mining execution
rules - List that stores frequent patterns
fileName - Name of the file to write statistics (with path)

saveToGraphML

public void saveToGraphML(Trie trie,
                          java.lang.String fileName,
                          java.lang.String[] params)
                   throws java.io.IOException
Writes a given trie data structure to specified file in GraphML format.

Parameters:
trie - A given trie.
Name - of a file to write (with path)
params - Specify what information from a trie should be written to a file.
Throws:
java.io.IOException

saveToGraphML

public void saveToGraphML(jdsl.core.api.Tree taxonomy,
                          java.lang.String fileName,
                          java.lang.String[] params)
                   throws java.io.IOException
Writes a given taxonomy of predicates or nodes to specified file in GraphML format.

Parameters:
taxonomy - A given taxonomy
Name - of a file to write (with path)
params - Specify what information from a taxonomy should be written to a file.
Throws:
java.io.IOException

readXMLSetupFile

public java.util.HashMap readXMLSetupFile(java.lang.String fileName)
Reads input arguments for the mining application, stored in XML file

Parameters:
fileName - Name of the file to read (with path)
Returns:
HasSet with application input arguments

readPatternList

public java.util.ArrayList readPatternList(java.lang.String fileName,
                                           org.semanticweb.kaon2.api.logic.Variable keyVar)
Reads a list of patterns (conjunctive queries) from file

Parameters:
fileName - Name of the file to read (with path)
keyVar - Key variable (the one in reference concept)
Returns:
List of patterns