org.opentox.toxotis.util.spiders
Class AlgorithmSpider

java.lang.Object
  extended by org.opentox.toxotis.util.spiders.Tarantula<Algorithm>
      extended by org.opentox.toxotis.util.spiders.AlgorithmSpider
All Implemented Interfaces:
Closeable

public class AlgorithmSpider
extends Tarantula<Algorithm>

A downloader parser for data models of OpenTox algorithms.

Author:
Charalampos Chomenides, Pantelis Sopasakis

Field Summary
 
Fields inherited from class org.opentox.toxotis.util.spiders.Tarantula
model, parseTime, readRemoteTime, resource
 
Constructor Summary
AlgorithmSpider(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.ontology.OntModel model)
          Constructor with an ontological resource and an ontological model.
AlgorithmSpider(VRI uri)
          Create a new AlgorithmSpider providing the URI of the algorithm to be spidered, i.e.
AlgorithmSpider(VRI uri, AuthenticationToken token)
          Create a new AlgorithmSpider providing the URI of the algorithm to be spidered and an authentication token that will allow the client to access the content of the algorithm.
 
Method Summary
 Algorithm parse()
          Parse the data model of an OpenTox entity and create an ToxOtis object according to the data content of the data model.
 
Methods inherited from class org.opentox.toxotis.util.spiders.Tarantula
assessHttpStatus, close, getOntModel, getOntologicalTypes, getOTATypes, getParseTime, getReadRemoteTime, retrievePropertyLiterals, retrievePropertyNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmSpider

public AlgorithmSpider(VRI uri)
                throws ServiceInvocationException
Create a new AlgorithmSpider providing the URI of the algorithm to be spidered, i.e. downloded from the remote location the URI specifies (as an RDF/XML document) and then parsed into an Algorithm object. Be aware that the invokation of this method assumes that no authentication or authorization mechanism exists on the remote server to control access to the resource and it can be freely accessed.

Parameters:
uri - The URI of the algorithm to be downloaded and parsed into an Algorithm object. You can pick an algorithm URI from the list inside Services; for example NTUA MLR from the NTUA SERVICES server.
Throws:
ToxOtisException - In case some exceptional event occurs during the server-client communication, the connection is not possible (e.g. the remote server is down), or the response status is 403 (Authentication Failed), 401 (The user is not authorized), 404 (Algorithm not found on the server), 500 (Some internal server error occured) or other exceptional status code.
ServiceInvocationException

AlgorithmSpider

public AlgorithmSpider(com.hp.hpl.jena.rdf.model.Resource resource,
                       com.hp.hpl.jena.ontology.OntModel model)
                throws BadRequestException
Constructor with an ontological resource and an ontological model.

Parameters:
resource - Ontological resource to be parsed.
model - Ontological model to be used for parsing.
Throws:
BadRequestException - If the URI of the provided resource is not a valid algorithm URI.

AlgorithmSpider

public AlgorithmSpider(VRI uri,
                       AuthenticationToken token)
                throws ServiceInvocationException
Create a new AlgorithmSpider providing the URI of the algorithm to be spidered and an authentication token that will allow the client to access the content of the algorithm.

Parameters:
uri - The URI of the algorithm to be downloaded and parsed into an Algorithm object. You can pick an algorithm URI from the list inside Services; for example NTUA MLR from the NTUA SERVICES server.
token - An authentication token that will grant the client access to the resource.
Throws:
ToxOtisException - In case some exceptional event occurs during the server-client communication, the connection is not possible (e.g. the remote server is down), or the response status is 403 (Authentication Failed), 401 (The user is not authorized), 404 (Algorithm not found on the server), 500 (Some internal server error occured) or other exceptional status code.
ServiceInvocationException
Method Detail

parse

public Algorithm parse()
                throws ServiceInvocationException
Description copied from class: Tarantula
Parse the data model of an OpenTox entity and create an ToxOtis object according to the data content of the data model.

Specified by:
parse in class Tarantula<Algorithm>
Returns:
The parsed object.
Throws:
ServiceInvocationException


Copyright © 2011-2012 OpenTox. All Rights Reserved.