info.sswap.api.spi
Interface APIProvider


public interface APIProvider

The interface implemented by the providers of the API. The methods of this interface create actual implementations of SSWAP interfaces.

Author:
Blazej Bulka

Method Summary
 com.hp.hpl.jena.rdf.model.Model asJenaModel(SSWAPModel model)
          Returns the representation of the given SSWAPModel using Jena interface
 SSWAPElement copyElement(SSWAPDocument dstDocument, SSWAPElement element)
           
 RDG createCompositeService(java.net.URI serviceURI, java.lang.String name, java.lang.String description, java.net.URI providerURI, RDG firstService, RDG lastService)
           
<T extends SSWAPDocument>
T
createDocument(com.hp.hpl.jena.rdf.model.Model model, java.lang.Class<T> clazz)
           
<T extends SSWAPDocument>
T
createDocument(com.hp.hpl.jena.rdf.model.Model model, java.lang.Class<T> clazz, java.net.URI uri)
           
 PDG createPDG(java.net.URI providerURI, java.lang.String name, java.lang.String oneLineDescription)
          Creates a new PDG (Provider Description Graph).
 SSWAPProvider createProvider(java.net.URI uri)
          Gets an undereferenced SSWAPProvider implementation
 RDG createRDG(java.net.URI resourceURI, java.lang.String name, java.lang.String oneLineDescription, java.net.URI providerURI)
          Creates a new RDG object.
 SSWAPResource createResource(java.net.URI uri)
          Gets an undereferenced SSWAPResource implementation
 RQG createRQG(java.net.URI resourceURI)
          Creates a basic RQG from scratch.
 SSWAPDocument createSSWAPDocument(java.net.URI uri)
          Creates an empty SSWAPModel.
 RQG generateRQG(RDG upstreamService, RDG downstreamService)
           
 RQG generateRQG(RDG upstreamService, RDG downstreamService, java.net.URI resultURI)
           
 RIG getAsyncRIG(java.net.URI serviceURI, java.net.URI upstreamRRG)
           
 Cache getCache()
           
 SSWAPDocument getClosureDocument(SSWAPDocument document)
           
 SSWAPDocument getInferredABox(SSWAPDocument document)
          Gets the document that contains the ABox of this document (including both inferred and asserted statements).
 SSWAPDocument getInferredDocument(SSWAPDocument document)
           
 SSWAPDocument getInferredTBox(SSWAPDocument document)
          Gets the document that contains the TBox of this document (including both inferred and asserted statements).
 java.util.Collection<java.lang.String> getInferredTypeURIs(SSWAPIndividual individual)
           
 PDG getPDG(java.net.URI uri)
          Gets an undereferenced PDG implementation.
 RDG getRDG(java.net.URI uri)
          Gets a dereferenced RDG implementation
<T extends SSWAPDocument>
T
getResourceGraph(java.io.InputStream is, java.lang.Class<T> clazz, java.net.URI uri)
          Creates a SSWAPDocument graph from its serialization in an input stream.
 RQG getRQG(java.io.InputStream is)
          Reads an RQG from an input stream.
<T extends SSWAPNode>
T
getUntranslatedNode(T translatedNode)
           
 RQG inputOnlyRQG(RQG rqg)
           
 boolean isUnrestricted(RQG rqg)
           
 RQG outputOnlyRQG(RQG rqg)
           
 void setClosureEnabled(SSWAPDocument document, boolean enabled)
           
 void setExplanationSyntax(java.lang.String explanationSyntax)
           
 void setMaxClosureBytes(SSWAPModel model, long byteLimit)
          Sets a model-specific byte limit to retrieve the closure
 void setMaxClosureThreads(SSWAPModel model, int threads)
          Sets a model-specific limit on the number of threads used to retrieve the closure
 void setMaxClosureTime(SSWAPModel model, long timeLimit)
          Sets a model-specific time limit to retrieve the closure
 void setValueValidation(SSWAPDocument document, boolean enabled)
           
 

Method Detail

getPDG

PDG getPDG(java.net.URI uri)
Gets an undereferenced PDG implementation.

Parameters:
uri - URI of the PDG
Returns:
the implementation of the PDG

createProvider

SSWAPProvider createProvider(java.net.URI uri)
Gets an undereferenced SSWAPProvider implementation

Parameters:
uri - URI of the provider
Returns:
the implementation of the SSWAPProvider

getRDG

RDG getRDG(java.net.URI uri)
           throws DataAccessException
Gets a dereferenced RDG implementation

Parameters:
uri - URI of the RDG
Returns:
the implementation of the RDG
Throws:
DataAccessException - if an error should occur while trying to access RDG's data

createResource

SSWAPResource createResource(java.net.URI uri)
Gets an undereferenced SSWAPResource implementation

Parameters:
uri - URI of the Resource
Returns:
the implementation of the resource

createRDG

RDG createRDG(java.net.URI resourceURI,
              java.lang.String name,
              java.lang.String oneLineDescription,
              java.net.URI providerURI)
Creates a new RDG object.

Parameters:
resourceURI - the URI of the SSWAP Resource (and the RDG itself)
name - the name of the service described in this RDG
oneLineDescription - a short description of the RDG
providerURI - an URI of the provider of this service
Returns:
the created RDG

getRQG

RQG getRQG(java.io.InputStream is)
Reads an RQG from an input stream.

Parameters:
is - the input stream containing the representation of the RQG
Returns:
the RQG

createRQG

RQG createRQG(java.net.URI resourceURI)
Creates a basic RQG from scratch. The created RQG contains only SSWAPResource.

Parameters:
resourceURI - the URI of the resource in the RQG; may be null for anonymous resources
Returns:
the RQG with a SSWAPResource

getResourceGraph

<T extends SSWAPDocument> T getResourceGraph(java.io.InputStream is,
                                             java.lang.Class<T> clazz,
                                             java.net.URI uri)
                                         throws DataAccessException
Creates a SSWAPDocument graph from its serialization in an input stream.

Type Parameters:
T - the template parameter that specifies the type of SSWAPDocument graph to be created (e.g., RDG, RIG, etc.).
Parameters:
is - the input stream from which the contents of the graph should be read
clazz - the Java Class object that identifies the type of SSWAPDocument graph (and provides the instantiation for the template parameter; e.g., RDG.class, RIG.class, etc.)
uri - the URI to dereference to obtain the graph
Returns:
the created SSWAPDocument graph
Throws:
DataAccessException - on parsing or other data error

createPDG

PDG createPDG(java.net.URI providerURI,
              java.lang.String name,
              java.lang.String oneLineDescription)
Creates a new PDG (Provider Description Graph).

Parameters:
providerURI - the URI of the SSWAP Provider (and the PDG itself)
name - the name of the provider described in this PDG
oneLineDescription - the one line description of the provider
Returns:
newly created PDG

createSSWAPDocument

SSWAPDocument createSSWAPDocument(java.net.URI uri)
Creates an empty SSWAPModel. This method can be used to contain other SSWAPModels if it is undesirable to create a full SSWAPCanonicalGraph or a PDG.

Parameters:
uri - the URI of the SSWAP model
Returns:
an empty SSWAP model

getInferredTBox

SSWAPDocument getInferredTBox(SSWAPDocument document)
                              throws java.lang.UnsupportedOperationException
Gets the document that contains the TBox of this document (including both inferred and asserted statements).

Parameters:
document - source SSWAPDocument
Returns:
the document with the TBox
Throws:
java.lang.UnsupportedOperationException - if the specified provider does not support this feature

getInferredABox

SSWAPDocument getInferredABox(SSWAPDocument document)
                              throws java.lang.UnsupportedOperationException
Gets the document that contains the ABox of this document (including both inferred and asserted statements).

Parameters:
document - source SSWAPDocument
Returns:
the document with the ABox
Throws:
java.lang.UnsupportedOperationException - if the specified provider does not support this feature

asJenaModel

com.hp.hpl.jena.rdf.model.Model asJenaModel(SSWAPModel model)
                                            throws java.lang.UnsupportedOperationException
Returns the representation of the given SSWAPModel using Jena interface

Parameters:
model - the SSWAPModel
Returns:
Jena model that contains the representation of this document
Throws:
java.lang.UnsupportedOperationException - if the specified provider does not support this feature

setMaxClosureThreads

void setMaxClosureThreads(SSWAPModel model,
                          int threads)
                          throws java.lang.UnsupportedOperationException
Sets a model-specific limit on the number of threads used to retrieve the closure

Parameters:
model - the model for which the limit should be set
threads - the number of threads, or -1 to remove any previous model-specific limit (a system-wide limit will be used for this model)
Throws:
java.lang.UnsupportedOperationException - if the operation is not supported by this API Implementation

setMaxClosureTime

void setMaxClosureTime(SSWAPModel model,
                       long timeLimit)
                       throws java.lang.UnsupportedOperationException
Sets a model-specific time limit to retrieve the closure

Parameters:
model - the model for which the limit should be set
timeLimit - the maximum number of milliseconds to retrieve the closure, or -1 to remove any previous model-specific limit (a system-wide limit will be used for this model)
Throws:
java.lang.UnsupportedOperationException - if the operation is not supported by this API Implementation

setMaxClosureBytes

void setMaxClosureBytes(SSWAPModel model,
                        long byteLimit)
                        throws java.lang.UnsupportedOperationException
Sets a model-specific byte limit to retrieve the closure

Parameters:
model - the model for which the limit should be set
byteLimit - the maximum number of bytes to retrieve the closure, or -1 to remove any previous model-specific limit (a system-wide limit will be used for this model)
Throws:
java.lang.UnsupportedOperationException - if the operation is not supported by this API Implementation

createDocument

<T extends SSWAPDocument> T createDocument(com.hp.hpl.jena.rdf.model.Model model,
                                           java.lang.Class<T> clazz)
                                       throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

createDocument

<T extends SSWAPDocument> T createDocument(com.hp.hpl.jena.rdf.model.Model model,
                                           java.lang.Class<T> clazz,
                                           java.net.URI uri)
                                       throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getClosureDocument

SSWAPDocument getClosureDocument(SSWAPDocument document)
                                 throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getInferredDocument

SSWAPDocument getInferredDocument(SSWAPDocument document)
                                  throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

setExplanationSyntax

void setExplanationSyntax(java.lang.String explanationSyntax)
                          throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

generateRQG

RQG generateRQG(RDG upstreamService,
                RDG downstreamService)
                throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

generateRQG

RQG generateRQG(RDG upstreamService,
                RDG downstreamService,
                java.net.URI resultURI)
                throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getAsyncRIG

RIG getAsyncRIG(java.net.URI serviceURI,
                java.net.URI upstreamRRG)
                throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

copyElement

SSWAPElement copyElement(SSWAPDocument dstDocument,
                         SSWAPElement element)
                         throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getCache

Cache getCache()

setValueValidation

void setValueValidation(SSWAPDocument document,
                        boolean enabled)
                        throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

setClosureEnabled

void setClosureEnabled(SSWAPDocument document,
                       boolean enabled)
                       throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getInferredTypeURIs

java.util.Collection<java.lang.String> getInferredTypeURIs(SSWAPIndividual individual)
                                                           throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

createCompositeService

RDG createCompositeService(java.net.URI serviceURI,
                           java.lang.String name,
                           java.lang.String description,
                           java.net.URI providerURI,
                           RDG firstService,
                           RDG lastService)
                           throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

inputOnlyRQG

RQG inputOnlyRQG(RQG rqg)
                 throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

outputOnlyRQG

RQG outputOnlyRQG(RQG rqg)
                  throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

isUnrestricted

boolean isUnrestricted(RQG rqg)
                       throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

getUntranslatedNode

<T extends SSWAPNode> T getUntranslatedNode(T translatedNode)
                                        throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.