org.apache.stanbol.reasoners.web.resources
Class ReasoningServiceTaskResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.reasoners.web.resources.ReasoningServiceTaskResource

public class ReasoningServiceTaskResource
extends BaseStanbolResource

Endpoint for reasoning services. Services can be invoked using the service name and task in the request path. The related active SCR service is selected, then the concrete execution is delegated to a ReasoningServiceExecutor. Two different kind of implementation of ReasoningService are supported: JenaReasoningService and OWLApiReasonngService. This class includes methods to prepare the input and dispatch the output (back to the client in the requested format or saved in the triple store). Support for long term operations is provided by adding /job to the request URI.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
BaseStanbolResource.MenuItem
 
Field Summary
 
Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, servletContext, STATIC_RESOURCES_ROOT_URL, uriInfo
 
Constructor Summary
ReasoningServiceTaskResource(java.lang.String serviceID, java.lang.String taskID, java.lang.String job, javax.servlet.ServletContext servletContext, javax.ws.rs.core.HttpHeaders headers, com.sun.jersey.api.core.HttpContext httpContext)
          Constructor
 
Method Summary
 javax.ws.rs.core.Response get(java.lang.String targetGraphID)
          Get the inferences from input URL.
 java.util.Set<ReasoningService<?,?,?>> getActiveServices()
          Gets the list of active services
 java.lang.String getCurrentPath()
          The actual path, to be used in the template.
 ReasoningService<?,?,?> getCurrentService()
          The selected service
 java.lang.String getCurrentTask()
          The selected task
 java.lang.String getJobLocation()
          If this resource created a job, this field contains the location to be rendered in the viewable.
 java.util.Map<java.lang.String,java.lang.String> getServiceDescription()
           
 java.util.Map<java.lang.String,java.lang.String> getServiceDescription(ReasoningService<?,?,?> service)
           
 java.util.List<java.lang.String> getSupportedTasks()
          The list of supported tasks.
 javax.ws.rs.core.Response post()
          This is an alias of the get method.
 javax.ws.rs.core.Response post(com.sun.jersey.multipart.FormDataMultiPart data)
          To catch additional parameters in case of a POST with content-type multipart/form-data, we need to access the FormDataMultiPart representation of the input.
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReasoningServiceTaskResource

public ReasoningServiceTaskResource(java.lang.String serviceID,
                                    java.lang.String taskID,
                                    java.lang.String job,
                                    @Context
                                    javax.servlet.ServletContext servletContext,
                                    @Context
                                    javax.ws.rs.core.HttpHeaders headers,
                                    @Context
                                    com.sun.jersey.api.core.HttpContext httpContext)
Constructor

Parameters:
serviceID -
taskID -
job -
servletContext -
headers -
httpContext -
Method Detail

post

public javax.ws.rs.core.Response post()
This is an alias of the get method.

Parameters:
url -
targetGraphID -
Returns:

get

public javax.ws.rs.core.Response get(java.lang.String targetGraphID)
Get the inferences from input URL. If url param is null, get the HTML description of this service/task

Parameters:
url -
Returns:

post

public javax.ws.rs.core.Response post(com.sun.jersey.multipart.FormDataMultiPart data)
To catch additional parameters in case of a POST with content-type multipart/form-data, we need to access the FormDataMultiPart representation of the input.

Parameters:
data -
Returns:

getCurrentPath

public java.lang.String getCurrentPath()
The actual path, to be used in the template.

Returns:

getCurrentService

public ReasoningService<?,?,?> getCurrentService()
The selected service

Returns:

getCurrentTask

public java.lang.String getCurrentTask()
The selected task

Returns:

getJobLocation

public java.lang.String getJobLocation()
If this resource created a job, this field contains the location to be rendered in the viewable.

Returns:

getSupportedTasks

public java.util.List<java.lang.String> getSupportedTasks()
The list of supported tasks. We include CHECK, which is managed directly by the endpoint.


getActiveServices

public java.util.Set<ReasoningService<?,?,?>> getActiveServices()
Gets the list of active services

Returns:

getServiceDescription

public java.util.Map<java.lang.String,java.lang.String> getServiceDescription()

getServiceDescription

public java.util.Map<java.lang.String,java.lang.String> getServiceDescription(ReasoningService<?,?,?> service)


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.