org.knime.core.node.port.pmml
Class PMMLDataDictionaryTranslator

java.lang.Object
  extended by org.knime.core.node.port.pmml.PMMLDataDictionaryTranslator
All Implemented Interfaces:
PMMLTranslator

public class PMMLDataDictionaryTranslator
extends Object
implements PMMLTranslator

Author:
Dominik Morent, KNIME.com, Zurich, Switzerland

Constructor Summary
PMMLDataDictionaryTranslator()
          Creates an empty PMML dictionary translator.
 
Method Summary
 org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc, DataTableSpec dts)
          Adds a data dictionary to the PMML document based on the DataTableSpec.
 org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc, PMMLPortObjectSpec spec)
          Exports the translators state to a PMML document.
 List<String> getActiveDerivedFields()
           
 DataTableSpec getDataTableSpec()
           
 List<String> getDictionaryFields()
           
static DataType getKNIMEDataType(org.dmg.pmml40.DATATYPE.Enum pmmlType)
           
static org.dmg.pmml40.OPTYPE.Enum getOptype(DataType dataType)
           
static org.dmg.pmml40.DATATYPE.Enum getPMMLDataType(DataType dataType)
           
 void initializeFrom(org.dmg.pmml40.PMMLDocument pmmlDoc)
          Initializes the translator based on a PMML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMMLDataDictionaryTranslator

public PMMLDataDictionaryTranslator()
Creates an empty PMML dictionary translator.

Method Detail

initializeFrom

public void initializeFrom(org.dmg.pmml40.PMMLDocument pmmlDoc)
Initializes the translator based on a PMML document.

Specified by:
initializeFrom in interface PMMLTranslator
Parameters:
pmmlDoc - the PMML document

exportTo

public org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc,
                                               PMMLPortObjectSpec spec)
Exports the translators state to a PMML document.

Specified by:
exportTo in interface PMMLTranslator
Parameters:
pmmlDoc - the PMML document to export to
spec - the spec of the PMMLPortObject
Returns:
the schema type of the exported schema if applicable, otherwise null

exportTo

public org.apache.xmlbeans.SchemaType exportTo(org.dmg.pmml40.PMMLDocument pmmlDoc,
                                               DataTableSpec dts)
Adds a data dictionary to the PMML document based on the DataTableSpec.

Parameters:
pmmlDoc - the PMML document to export to
dts - the data table spec
Returns:
the schema type of the exported schema if applicable, otherwise null
See Also:
exportTo(PMMLDocument, PMMLPortObjectSpec)

getOptype

public static org.dmg.pmml40.OPTYPE.Enum getOptype(DataType dataType)
Parameters:
dataType - the data type to get the PMML optype type for
Returns:
the PMML data type for the DataColumnSpec

getKNIMEDataType

public static DataType getKNIMEDataType(org.dmg.pmml40.DATATYPE.Enum pmmlType)
Parameters:
pmmlType - the PMML data type
Returns:
the corresponding DataType in KNIME

getPMMLDataType

public static org.dmg.pmml40.DATATYPE.Enum getPMMLDataType(DataType dataType)
Parameters:
dataType - the KNIME data type to get the PMML data type attribute for
Returns:
the PMML data type for the DataType

getDataTableSpec

public DataTableSpec getDataTableSpec()
Returns:
the data table spec or null if the initializeFrom(PMMLDocument) has not been invoked before

getActiveDerivedFields

public List<String> getActiveDerivedFields()
Returns:
the activeDerivedFields

getDictionaryFields

public List<String> getDictionaryFields()
Returns:
the dictFields


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.