net.sourceforge.fluxion.spring
Class QueryTransformingFluxionService

java.lang.Object
  extended by net.sourceforge.fluxion.spring.QueryTransformingFluxionService
All Implemented Interfaces:
FluxionService, org.springframework.beans.factory.InitializingBean

public class QueryTransformingFluxionService
extends java.lang.Object
implements FluxionService, org.springframework.beans.factory.InitializingBean

Implementation of FluxionService which delegates to a list of other FluxionServices and transforms queries with an injected QueryTransformer. The transformation is driven from a list of QueryTransformerConfiguration beans.

Author:
Tom Oinn

Constructor Summary
QueryTransformingFluxionService()
          Create a new transforming fluxion service instance, does very little configuration by default - use the set methods to inject resources.
 
Method Summary
 void afterPropertiesSet()
          Use the bean initializer hook to call out to the injected query transformer to get the exposed schemata for all configured mappings
 java.util.Set<java.net.URI> getDataSources()
          Return the set of exposed data source URIs from all configurations
 java.net.URI getId()
          The ID of this service.
 java.net.URI getReasonerLevel(java.net.URI dataSource)
          Currently returns the constant 'http://www.w3.org/ns/owl2-xml' as the reasoner level
 org.semanticweb.owl.model.OWLOntology getSchema(java.net.URI dataSource)
          Search for a configuration with the specified exposed URI and return its exposed schema property
 org.semanticweb.owl.model.OWLOntology query(java.net.URI dataSourceURI, java.net.URI queryClassURI, org.semanticweb.owl.model.OWLOntology queryOntology)
          Do a query, transforming the query request and response messages using the injected query transformer and passing it the appropriate configuration
 void setMapping(java.util.List<QueryTransformerConfiguration> configurations)
          Inject a list of configuration objects defining the mapping from underlying data source to rules documents
 void setQueryTransformer(QueryTransformer transformer)
          Inject a QueryTransformer to perform the actual query manipulation
 void setServices(java.util.List<FluxionService> services)
          Inject a list of one or more fluxion services which can be mapped by this transforming service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryTransformingFluxionService

public QueryTransformingFluxionService()
Create a new transforming fluxion service instance, does very little configuration by default - use the set methods to inject resources.

Method Detail

setQueryTransformer

public void setQueryTransformer(QueryTransformer transformer)
Inject a QueryTransformer to perform the actual query manipulation


setServices

public void setServices(java.util.List<FluxionService> services)
                 throws DataSourceException
Inject a list of one or more fluxion services which can be mapped by this transforming service

Throws:
DataSourceException

setMapping

public void setMapping(java.util.List<QueryTransformerConfiguration> configurations)
Inject a list of configuration objects defining the mapping from underlying data source to rules documents


getId

public java.net.URI getId()
The ID of this service. In this instance, a URI minted from the service's toString.

Specified by:
getId in interface FluxionService
Returns:
a identifying this service.

getDataSources

public java.util.Set<java.net.URI> getDataSources()
                                           throws DataSourceException
Return the set of exposed data source URIs from all configurations

Specified by:
getDataSources in interface FluxionService
Returns:
a of s giving each known data source
Throws:
DataSourceException

getReasonerLevel

public java.net.URI getReasonerLevel(java.net.URI dataSource)
                              throws DataSourceException
Currently returns the constant 'http://www.w3.org/ns/owl2-xml' as the reasoner level

Specified by:
getReasonerLevel in interface FluxionService
Parameters:
dataSource - the being operated upon
Returns:
a giving the reasoner semantics in effect
Throws:
DataSourceException - if the data source is not known by this service or if there was an error connecting to the data source

getSchema

public org.semanticweb.owl.model.OWLOntology getSchema(java.net.URI dataSource)
                                                throws DataSourceException
Search for a configuration with the specified exposed URI and return its exposed schema property

Specified by:
getSchema in interface FluxionService
Parameters:
dataSource - the being operated upon
Returns:
an describing the range of concepts this service may publish
Throws:
DataSourceException - if the data source is not known by this service or if there was an error connecting to the data source

query

public org.semanticweb.owl.model.OWLOntology query(java.net.URI dataSourceURI,
                                                   java.net.URI queryClassURI,
                                                   org.semanticweb.owl.model.OWLOntology queryOntology)
                                            throws DataSourceException
Do a query, transforming the query request and response messages using the injected query transformer and passing it the appropriate configuration

Specified by:
query in interface FluxionService
Parameters:
dataSourceURI - the being operated upon
queryClassURI - the qualified name of the class from the specified ontology for which instances should be found
queryOntology - the ontology containing the specified query class
Returns:
the result of the query as an OWLOntology
Throws:
DataSourceException - if the data source is not known by this service or if there was an error connecting to the data source

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Use the bean initializer hook to call out to the injected query transformer to get the exposed schemata for all configured mappings

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception


Copyright © 2010. All Rights Reserved.