org.opentox.toxotis.core.component
Class ServiceRestDocumentation

java.lang.Object
  extended by org.opentox.toxotis.core.OTComponent<ServiceRestDocumentation>
      extended by org.opentox.toxotis.core.component.ServiceRestDocumentation
All Implemented Interfaces:
Serializable, IOTComponent, IStAXWritable

public class ServiceRestDocumentation
extends OTComponent<ServiceRestDocumentation>

Provides a machine-readable documentation for the consumption of all available services provided including information about diffferent HTTP methods, possible status codes, input parameters and more. This can be used to generate human-readable guidelines for the invokation of the web service.

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

Field Summary
 
Fields inherited from class org.opentox.toxotis.core.OTComponent
meta, RDF_ABOUT, RDF_RDF, RDF_RESOURCE, RDF_TYPE
 
Constructor Summary
ServiceRestDocumentation(IOTComponent component)
          A ServiceRestDocumentation object should be initialized with an OpenTox component.
 
Method Summary
 ServiceRestDocumentation addRestOperations(IRestOperation... restOperations)
           
 com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
          The OpenTox component as an individual.
 IOTComponent getComponent()
           
 MetaInfo getMeta()
          Obtain meta information about the underlying OpenTox resource/component.
 Set<OntologicalClass> getOntologicalClasses()
          The list of ontological classes for the current entity.
 Set<IRestOperation> getRestOperations()
           
 VRI getUri()
          Get the URI of the resource (as an instance of VRI.
 ServiceRestDocumentation setRestOperations(Set<IRestOperation> restOperations)
           
 void writeRdf(XMLStreamWriter writer)
          Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream).
 
Methods inherited from class org.opentox.toxotis.core.OTComponent
addOntologicalClasses, asOntModel, endRdfWriter, equals, hashCode, 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, toString, wait, wait, wait
 

Constructor Detail

ServiceRestDocumentation

public ServiceRestDocumentation(IOTComponent component)
A ServiceRestDocumentation object should be initialized with an OpenTox component.

Parameters:
component - An opentox component or an instance of {@link DummyCompo
Method Detail

getRestOperations

public Set<IRestOperation> getRestOperations()

setRestOperations

public ServiceRestDocumentation setRestOperations(Set<IRestOperation> restOperations)

addRestOperations

public ServiceRestDocumentation addRestOperations(IRestOperation... restOperations)

getComponent

public IOTComponent getComponent()

getMeta

public MetaInfo getMeta()
Description copied from class: OTComponent
Obtain meta information about the underlying OpenTox resource/component. These meta information include various fields of the Dublin Core ontology (title, identifier), properties from the OpenTox ontology (see http://opentox.org/data/documents/development/RDF%20Files/OpenToxOntology) and some elements from other ontologies like rdfs:comment

Specified by:
getMeta in interface IOTComponent
Overrides:
getMeta in class OTComponent<ServiceRestDocumentation>
Returns:
Meta information about the resource

getUri

public VRI getUri()
Description copied from class: OTComponent
Get the URI of the resource (as an instance of VRI. Anonymous resources, return null

Specified by:
getUri in interface IOTComponent
Overrides:
getUri in class OTComponent<ServiceRestDocumentation>
Returns:
URI of the component or null if not any.

getOntologicalClasses

public Set<OntologicalClass> getOntologicalClasses()
Description copied from interface: IOTComponent
The list of ontological classes for the current entity.

Specified by:
getOntologicalClasses in interface IOTComponent
Overrides:
getOntologicalClasses in class OTComponent<ServiceRestDocumentation>
Returns:
Set of ontological classes.

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.

writeRdf

public void writeRdf(XMLStreamWriter writer)
              throws XMLStreamException
Description copied from interface: IStAXWritable
Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream). In the case of Datasets, it has been shown that this method performs much faster (about 7,5 times faster on a dataset of 21 features and 1000 compounds).

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.


Copyright © 2011-2012 OpenTox. All Rights Reserved.