org.opentox.toxotis.core
Class OTComponent<T extends IOTComponent>

java.lang.Object
  extended by org.opentox.toxotis.core.OTComponent<T>
Type Parameters:
T -
All Implemented Interfaces:
Serializable, IOTComponent, IStAXWritable
Direct Known Subclasses:
AASpecifications, Bookmark, DataEntry, DummyComponent, ErrorReport, FeatureValue, HttpMediatype, HttpMethod, HttpParameter, HttpStatus, MultiParameter, OTOnlineResource, Parameter, ParameterValue, RestOperation, ServiceRestDocumentation, VariableInfo, VariableValue

public abstract class OTComponent<T extends IOTComponent>
extends Object
implements IOTComponent, IStAXWritable, Serializable

Abstract class that includes all OpenTox components. This class is on the top of the class hierarchy in this package.

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

Field Summary
protected  MetaInfo meta
          Meta information (including DC and OT meta) about the component
protected static String RDF_ABOUT
           
protected static String RDF_RDF
           
protected static String RDF_RESOURCE
           
protected static String RDF_TYPE
           
 
Constructor Summary
protected OTComponent()
          Constructor for an empty OpenTox Component
protected OTComponent(VRI uri)
           
 
Method Summary
 T addOntologicalClasses(OntologicalClass... ontClasses)
          Adds a list of ontological classes to the current ones.
 com.hp.hpl.jena.ontology.OntModel asOntModel()
          Creates a new Ontological Model (uses an instance of SimpleOntModelImpl) and assigns to it the Individual from the method asIndividual(OntModel).
protected  void endRdfWriter(XMLStreamWriter writer)
           
 boolean equals(Object obj)
           
 MetaInfo getMeta()
          Obtain meta information about the underlying OpenTox resource/component.
 Set<OntologicalClass> getOntologicalClasses()
          The list of ontological classes for the current entity.
 VRI getUri()
          Get the URI of the resource (as an instance of VRI.
 int hashCode()
           
protected  void initRdfWriter(XMLStreamWriter writer)
           
 boolean isEnabled()
          When a component is deleted, then it is disabled.
 T setEnabled(boolean enabled)
          Sets the status of the current modifiable entity.
 T setMeta(MetaInfo meta)
          Set the meta-information of the component
 T setOntologicalClasses(Set ontClasses)
          A simple setter for the ontological classes of the current OT-component.
 T setUri(VRI uri)
          Set the URI of the component which has to be an instance of VRI
protected  void writeAnnotationProperty(XMLStreamWriter writer, String annotationPropertyUri)
           
protected  void writeClass(XMLStreamWriter writer, OntologicalClass clazz)
           
protected  void writeDatatypeProperty(XMLStreamWriter writer, OTDatatypeProperty property)
           
protected  void writeMetaDataProperties(XMLStreamWriter writer)
          Appends declarations for all metadata properties at the current cursor position of the writer.
protected  void writeObjectProperty(XMLStreamWriter writer, OTObjectProperty property)
           
 void writeRdf(OutputStream output)
          Serializes the Dataset object into an RDF/XML document and writes it to a given output stream.
 void writeRdf(Writer writer)
          Serializes the Dataset object into an RDF/XML document and writes it to an output stream using a java.io.Writer.
protected  void writeSuperClassRelationships(XMLStreamWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opentox.toxotis.core.IStAXWritable
writeRdf
 
Methods inherited from interface org.opentox.toxotis.core.IOTComponent
asIndividual
 

Field Detail

meta

protected MetaInfo meta
Meta information (including DC and OT meta) about the component


RDF_ABOUT

protected static final String RDF_ABOUT
See Also:
Constant Field Values

RDF_RESOURCE

protected static final String RDF_RESOURCE
See Also:
Constant Field Values

RDF_TYPE

protected static final String RDF_TYPE
See Also:
Constant Field Values

RDF_RDF

protected static final String RDF_RDF
See Also:
Constant Field Values
Constructor Detail

OTComponent

protected OTComponent()
Constructor for an empty OpenTox Component


OTComponent

protected OTComponent(VRI uri)
Method Detail

isEnabled

public boolean isEnabled()
When a component is deleted, then it is disabled.

Specified by:
isEnabled in interface IOTComponent
Returns:
true if the component is enabled, or false otherwise.

setEnabled

public T setEnabled(boolean enabled)
Description copied from interface: IOTComponent
Sets the status of the current modifiable entity.

Specified by:
setEnabled in interface IOTComponent
Parameters:
enabled - Whether to enable or to disable the current instance.
Returns:
The current modifiable object updated with the new value of the enabled status.

getMeta

public MetaInfo getMeta()
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
Returns:
Meta information about the resource

setMeta

public T setMeta(MetaInfo meta)
Set the meta-information of the component

Specified by:
setMeta in interface IOTComponent
Parameters:
meta - Meta information for the component
Returns:
The component itself with the updated meta-information
See Also:
Meta Information

asOntModel

public com.hp.hpl.jena.ontology.OntModel asOntModel()
Creates a new Ontological Model (uses an instance of SimpleOntModelImpl) and assigns to it the Individual from the method asIndividual(OntModel). The ontological model will contain no other information apart from the representation of the inderlying OpenTox component.

Specified by:
asOntModel in interface IOTComponent
Returns:
An ontological model for the current OpenTox component.

getUri

public VRI getUri()
Get the URI of the resource (as an instance of VRI. Anonymous resources, return null

Specified by:
getUri in interface IOTComponent
Returns:
URI of the component or null if not any.

setUri

public T setUri(VRI uri)
Set the URI of the component which has to be an instance of VRI

Parameters:
uri - URI of component
Returns:
The component itself with the updated URI

writeRdf

public void writeRdf(Writer writer)
Description copied from interface: IStAXWritable
Serializes the Dataset object into an RDF/XML document and writes it to an output stream using a java.io.Writer.

Specified by:
writeRdf in interface IStAXWritable
Parameters:
writer - A Writer used to write the RDF representation to an output destination.

writeRdf

public void writeRdf(OutputStream output)
Description copied from interface: IStAXWritable
Serializes the Dataset object into an RDF/XML document and writes it to a given output stream.

Specified by:
writeRdf in interface IStAXWritable
Parameters:
output - OutputStream where the output should be written.

writeMetaDataProperties

protected void writeMetaDataProperties(XMLStreamWriter writer)
                                throws XMLStreamException
Appends declarations for all metadata properties at the current cursor position of the writer.

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.

initRdfWriter

protected void initRdfWriter(XMLStreamWriter writer)
                      throws XMLStreamException
Throws:
XMLStreamException

endRdfWriter

protected void endRdfWriter(XMLStreamWriter writer)
                     throws XMLStreamException
Throws:
XMLStreamException

writeClass

protected void writeClass(XMLStreamWriter writer,
                          OntologicalClass clazz)
                   throws XMLStreamException
Throws:
XMLStreamException

writeSuperClassRelationships

protected void writeSuperClassRelationships(XMLStreamWriter writer)
                                     throws XMLStreamException
Throws:
XMLStreamException

writeObjectProperty

protected void writeObjectProperty(XMLStreamWriter writer,
                                   OTObjectProperty property)
                            throws XMLStreamException
Throws:
XMLStreamException

writeDatatypeProperty

protected void writeDatatypeProperty(XMLStreamWriter writer,
                                     OTDatatypeProperty property)
                              throws XMLStreamException
Throws:
XMLStreamException

writeAnnotationProperty

protected void writeAnnotationProperty(XMLStreamWriter writer,
                                       String annotationPropertyUri)
                                throws XMLStreamException
Throws:
XMLStreamException

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
Returns:
Set of ontological classes.

setOntologicalClasses

public T setOntologicalClasses(Set ontClasses)
Description copied from interface: IOTComponent
A simple setter for the ontological classes of the current OT-component.

Specified by:
setOntologicalClasses in interface IOTComponent
Parameters:
ontClasses - The Set of ontological classes to be prescribed for the current component.
Returns:
The current component with the updated set of ontological classes.

addOntologicalClasses

public T addOntologicalClasses(OntologicalClass... ontClasses)
Description copied from interface: IOTComponent
Adds a list of ontological classes to the current ones.

Specified by:
addOntologicalClasses in interface IOTComponent
Parameters:
ontClasses - An array of ontological classes.
Returns:
The current modifiable object updated with the new ontological classes.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011-2012 OpenTox. All Rights Reserved.