org.opentox.toxotis.core.component
Class Feature

java.lang.Object
  extended by org.opentox.toxotis.core.OTComponent<T>
      extended by org.opentox.toxotis.core.OTOnlineResource<T>
          extended by org.opentox.toxotis.core.OTPublishable<Feature>
              extended by org.opentox.toxotis.core.component.Feature
All Implemented Interfaces:
Serializable, IOnlineResource, IOTComponent, IStAXWritable

public class Feature
extends OTPublishable<Feature>

A Feature is an object,representing any kind of property, assigned to a Compound. The feature types are determined via their links to ontologies (Feature ontologies, Decsriptor ontologies, Endpoints ontologies). OpenTox has established an ontology for biological/toxicological and chemical features that is available online.

Author:
Pantelis Sopasakis, Charalampos Chomenides
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opentox.toxotis.core.OTOnlineResource
XSD_DATATYPE_LINKS
 
Fields inherited from class org.opentox.toxotis.core.OTComponent
meta, RDF_ABOUT, RDF_RDF, RDF_RESOURCE, RDF_TYPE
 
Constructor Summary
Feature()
           
Feature(VRI uri)
           
 
Method Summary
 com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
          The OpenTox component as an individual.
 boolean equals(Object obj)
           
 Set<LiteralValue> getAdmissibleValues()
           
 Set<OntologicalClass> getLowLevelOntologies()
          The lower-level ontological classes that are necessary to characterize the features.
 String getUnits()
          Returns the units of the feature as a string.
 int hashCode()
           
protected  Feature loadFromRemote(VRI uri, AuthenticationToken token)
          Loads an OpenTox component from a remote location identified by its uri and parses it into an instance of T.
 Task publishOnline(AuthenticationToken token)
          Publish the component to a standard (default) server.
 Task publishOnline(VRI vri, AuthenticationToken token)
          Publish the component to a proper server identified by the uri of the publishing service provided in this method.
 void setAdmissibleValues(Set<LiteralValue> admissibleValue)
           
 void setLowLevelOntologies(Set<OntologicalClass> ontologies)
          What this method does is that it sets the ontological classes of the current entity to the prescribed values if there are no other ontological classes already defined.
 void setUnits(String units)
          Setter method for the units of the feature.
 String toString()
           
 void writeRdf(XMLStreamWriter writer)
          This method is still under development, so maybe the created RDF/XML representation is not fully compliant to the OpenTox API.
 
Methods inherited from class org.opentox.toxotis.core.OTPublishable
publish, publish
 
Methods inherited from class org.opentox.toxotis.core.OTOnlineResource
download, download, download, download, downloadImage, loadFromRemote, loadFromRemote
 
Methods inherited from class org.opentox.toxotis.core.OTComponent
addOntologicalClasses, asOntModel, endRdfWriter, getMeta, getOntologicalClasses, getUri, initRdfWriter, isEnabled, setEnabled, setMeta, setOntologicalClasses, setUri, writeAnnotationProperty, writeClass, writeDatatypeProperty, writeMetaDataProperties, writeObjectProperty, writeRdf, writeRdf, writeSuperClassRelationships
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opentox.toxotis.core.IOTComponent
addOntologicalClasses, asOntModel, getMeta, getOntologicalClasses, getUri, isEnabled, setEnabled, setMeta, setOntologicalClasses
 

Constructor Detail

Feature

public Feature()

Feature

public Feature(VRI uri)
Method Detail

getAdmissibleValues

public Set<LiteralValue> getAdmissibleValues()

setAdmissibleValues

public void setAdmissibleValues(Set<LiteralValue> admissibleValue)

getLowLevelOntologies

public Set<OntologicalClass> getLowLevelOntologies()
The lower-level ontological classes that are necessary to characterize the features. For example, if the feature is both an instance of ot:Feature and ot:NumericFeature, then the latter suffices to describe the ontological properties of the entity - therefore ot:Feature can be omitted as it offers no meaningful information.

Returns:
Set of lower-level ontologies

setLowLevelOntologies

public void setLowLevelOntologies(Set<OntologicalClass> ontologies)
What this method does is that it sets the ontological classes of the current entity to the prescribed values if there are no other ontological classes already defined. In any other case, the ontological classes provided are appended to the set of existing ones.

Parameters:
ontologies - A set of ontological classes.
See Also:
OntologicalClass

getUnits

public String getUnits()
Returns the units of the feature as a string.

Returns:
Units string.

setUnits

public void setUnits(String units)
Setter method for the units of the feature.

Parameters:
units - Units of the feature.

asIndividual

public com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
Description copied from interface: IOTComponent
The OpenTox component as an individual.

Parameters:
model - The ontological model to which the individual belongs.
Returns:
The OpenTox component as an individual of a data model.

toString

public String toString()
Overrides:
toString in class Object

loadFromRemote

protected Feature loadFromRemote(VRI uri,
                                 AuthenticationToken token)
                          throws ServiceInvocationException
Description copied from class: OTOnlineResource
Loads an OpenTox component from a remote location identified by its uri and parses it into an instance of T. This method is protected and should be implemented by all subclasses of OTOnlineResource. The method is invoked by its public counterpart OTOnlineResource.loadFromRemote(org.opentox.toxotis.util.aa.AuthenticationToken) which accesses the remote location providing an authentication token.

Specified by:
loadFromRemote in class OTOnlineResource<Feature>
Parameters:
uri - Identifier of the location from where the component should be downloaded and parsed
token - Token provided
Returns:
Parsed instance of the component.
Throws:
ServiceInvocationException

publishOnline

public Task publishOnline(VRI vri,
                          AuthenticationToken token)
                   throws ServiceInvocationException
Description copied from class: OTPublishable
Publish the component to a proper server identified by the uri of the publishing service provided in this method. The resource will be posted to the server in RDF format (application/rdf+xml).

Specified by:
publishOnline in class OTPublishable<Feature>
Parameters:
vri - URI of the service that is responsible for the publication of this kind of resources.
token - Provide an authentication token. If you think that the service does not require auhtentication/authorization, you can leave this field null or you can provide an empty authentication token. If the provided URI already contains an authentication token (as the URL parameter tokenid) it will be replaced by the new token provided to this method.
Returns:
A Task for monitoring the progress of your request. If the service returns the URI of the resource right away and does not return a task, then the object you will receive from this method will now have an identifier, its status will be set to Completed, its progress will be set to 100% and the URI of the created resource will be available applying the method Task.getResultUri() on the returned task. In any case, the service's response will be wrapped in a Task object.
Throws:
ServiceInvocationException

publishOnline

public Task publishOnline(AuthenticationToken token)
                   throws ServiceInvocationException
Description copied from class: OTPublishable
Publish the component to a standard (default) server. The resource will be posted to the server in RDF format (application/rdf+xml). If you want to specify at which server the resource should be posted, use the other method.

Specified by:
publishOnline in class OTPublishable<Feature>
Parameters:
token - Provide an authentication token. If you think that the service does not require auhtentication/authorization, you can leave this field null or you can provide an empty authentication token.If the provided URI already contains an authentication token (as the URL parameter tokenid) it will be replaced by the new token provided to this method.
Returns:
A Task for monitoring the progress of your request. If the service returns the URI of the resource right away and does not return a task, then the object you will receive from this method will now have an identifier, its status will be set to Completed, its progress will be set to 100% and the URI of the created resource will be available applying the method Task.getResultUri() on the returned task. In any case, the service's response will be wrapped in a Task object.
Throws:
ServiceInvocationException - In case of invalid credentials, if the POSTed resource is not acceptable by the remote service (returns a status code 400), communication error occur with the remote server or other connection problems or the access to the service was denied (401 or 403).
See Also:
alternative method

writeRdf

public void writeRdf(XMLStreamWriter writer)
              throws XMLStreamException
This method is still under development, so maybe the created RDF/XML representation is not fully compliant to the OpenTox API.

Parameters:
writer - XML Stream Writer used for the serialization of the dataset object.
Throws:
XMLStreamException - In case the serialization is not possible due to syntax errors.
XMLStreamException - In case the serialization is not possible due to syntax errors.

equals

public boolean equals(Object obj)
Overrides:
equals in class OTComponent<Feature>

hashCode

public int hashCode()
Overrides:
hashCode in class OTComponent<Feature>


Copyright © 2011-2012 OpenTox. All Rights Reserved.