org.opentox.ontology.rdf
Class Model

java.lang.Object
  extended by org.opentox.error.ErrorSource
      extended by org.opentox.ontology.rdf.RDFHandler
          extended by org.opentox.ontology.rdf.Model
All Implemented Interfaces:
java.io.Serializable, IModel, IProne2Error

public class Model
extends RDFHandler
implements java.io.Serializable, IModel

This class is used to parse and generate RDF representations of Models.

Version:
1.3.3 (Last update: Dec 23, 2009)
Author:
OpenTox - http://www.opentox.org/, Sopasakis Pantelis, Sarimveis Harry
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class org.opentox.ontology.rdf.RDFHandler
jenaModel
 
Fields inherited from class org.opentox.error.ErrorSource
errorRep
 
Constructor Summary
Model()
           
Model(java.io.InputStream in)
          Initialized a new instance of Model reading its content from an input stream which can be a FileInputStream or an InputStream pointing to a web Resource.
 
Method Summary
 boolean compatibleWith(weka.core.Instances testData)
          Check the assertion that a certain weka.core.Instances object is compatible with this model in terms of having proper features.
 void createModel(ModelMeta meta, java.io.OutputStream out)
          Creates the RDF representation for an OpenTox model given its name, the uri of the dataset used to train it, its target feature, the Data and a List of tuning parameters for the training algorithm.
 java.lang.String getDependentFeatureUri()
          Returns the dependent features of the model.
 java.lang.String getPredictedFeatureUri()
          Get the URI of the predicted feature of the model.
 java.util.Set<java.lang.String> getSetOfIndependentFeatures()
          The set of independent variables of the model.
 java.util.Set<java.lang.String> setOfFeatures()
          Returns the set of all features in the Model (RDF representation) including dependent, independent and predicted ones.
 
Methods inherited from class org.opentox.ontology.rdf.RDFHandler
getClassMemberIteratorFor, getJenaModel
 
Methods inherited from class org.opentox.error.ErrorSource
getErrorRep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opentox.interfaces.IProne2Error
getErrorRep
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

Model

public Model()

Model

public Model(java.io.InputStream in)
Initialized a new instance of Model reading its content from an input stream which can be a FileInputStream or an InputStream pointing to a web Resource.

Parameters:
in - InputStream for reading the content of the Model.
See Also:
URLConnection.getInputStream()
Method Detail

setOfFeatures

public java.util.Set<java.lang.String> setOfFeatures()
Returns the set of all features in the Model (RDF representation) including dependent, independent and predicted ones.

Returns:
set of all features or the model.

getSetOfIndependentFeatures

public java.util.Set<java.lang.String> getSetOfIndependentFeatures()
The set of independent variables of the model.

Specified by:
getSetOfIndependentFeatures in interface IModel
Returns:
set of URIs

getDependentFeatureUri

public java.lang.String getDependentFeatureUri()
Returns the dependent features of the model.

Specified by:
getDependentFeatureUri in interface IModel
Returns:
dependent feature URI as a String.

getPredictedFeatureUri

public java.lang.String getPredictedFeatureUri()
Get the URI of the predicted feature of the model.

Specified by:
getPredictedFeatureUri in interface IModel
Returns:
URI of predicted feature.

createModel

public void createModel(ModelMeta meta,
                        java.io.OutputStream out)
Creates the RDF representation for an OpenTox model given its name, the uri of the dataset used to train it, its target feature, the Data and a List of tuning parameters for the training algorithm. The RDF document is built according to the specification of OpenTox API (v 1.1).

Specified by:
createModel in interface IModel
Parameters:
meta - Meta-information about the model.
out - OutputStream used to write the RDF representation of the model.

compatibleWith

public boolean compatibleWith(weka.core.Instances testData)
Check the assertion that a certain weka.core.Instances object is compatible with this model in terms of having proper features. In fact the set of attributes of testData must be a hyperset of the dependent attributes of the model. In plain english, the testData set should provide at least the information needed.

Specified by:
compatibleWith in interface IModel
Parameters:
testData -
Returns:
Returns true if this Model object is compatible with the specified dataset.