org.eclipse.rdf4j.query.algebra.evaluation.federation

## Class TupleFunctionFederatedService

- java.lang.Object
- - org.eclipse.rdf4j.query.algebra.evaluation.federation.TupleFunctionFederatedService

- All Implemented Interfaces:
    FederatedService

      public class TupleFunctionFederatedService
      extends Object
      implements FederatedService

  A federated service that can evaluate `TupleFunction`s.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleFunctionFederatedService(TupleFunctionRegistry tupleFunctionRegistry, ValueFactory vf)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `ask(Service service, BindingSet bindings, String baseUri)` Evaluate the provided SPARQL ASK query at this federated service.
    `CloseableIteration<BindingSet,QueryEvaluationException>` | `evaluate(Service service, CloseableIteration<BindingSet,QueryEvaluationException> bindings, String baseUri)` Evaluate the provided SPARQL query at this federated service, possibilities for vectored evaluation.
    `void` | `initialize()` Method to perform any initializations, invoked after construction.
    `boolean` | `isInitialized()` Method to check if `FederatedService.initialize()` had been called.
    `CloseableIteration<BindingSet,QueryEvaluationException>` | `select(Service service, Set<String> projectionVars, BindingSet bindings, String baseUri)` Evaluate the provided SPARQL query at this federated service.
    `void` | `shutdown()` Method to perform any shutDown code, invoked at unregistering.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TupleFunctionFederatedService

          public TupleFunctionFederatedService(TupleFunctionRegistry tupleFunctionRegistry,
                                               ValueFactory vf)

  - ### Method Detail

    - #### isInitialized

          public boolean isInitialized()

      Description copied from interface: `FederatedService`
      Method to check if `FederatedService.initialize()` had been called.
      Specified by:
        `isInitialized` in interface `FederatedService`

    - #### initialize

          public void initialize()

      Description copied from interface: `FederatedService`
      Method to perform any initializations, invoked after construction.
      Specified by:
        `initialize` in interface `FederatedService`

    - #### shutdown

          public void shutdown()

      Description copied from interface: `FederatedService`
      Method to perform any shutDown code, invoked at unregistering.
      Specified by:
        `shutdown` in interface `FederatedService`

    - #### ask

          public boolean ask(Service service,
                             BindingSet bindings,
                             String baseUri)
                      throws QueryEvaluationException

      Description copied from interface: `FederatedService`

      Evaluate the provided SPARQL ASK query at this federated service.

           Expected behavior: evaluate boolean query using the bindings as constraints

      Specified by:
        `ask` in interface `FederatedService`
      Parameters:
        `service` - the reference to the service node, contains additional meta information (vars, prefixes)
        `bindings` - the bindings serving as additional constraints
      Returns:
        `true` if at least one result exists
      Throws:
        `QueryEvaluationException` - If there was an exception generated while evaluating the query.

    - #### select

          public CloseableIteration<BindingSet,QueryEvaluationException> select(Service service,
                                                                                Set<String> projectionVars,
                                                                                BindingSet bindings,
                                                                                String baseUri)
                                                                         throws QueryEvaluationException

      Description copied from interface: `FederatedService`

      Evaluate the provided SPARQL query at this federated service.

      Important: The original bindings need to be inserted into the result.

           Expected behavior: evaluate the given SPARQL query using the bindings as constraints

      Specified by:
        `select` in interface `FederatedService`
      Parameters:
        `service` - the reference to the service node, contains additional meta information (vars, prefixes)
        `projectionVars` - The variables with unknown value that should be projected from this evaluation
        `bindings` - the bindings serving as additional constraints
      Returns:
        an iteration over the results of the query
      Throws:
        `QueryEvaluationException` - If there was an exception generated while evaluating the query.

    - #### evaluate

          public final CloseableIteration<BindingSet,QueryEvaluationException> evaluate(Service service,
                                                                                        CloseableIteration<BindingSet,QueryEvaluationException> bindings,
                                                                                        String baseUri)
                                                                                 throws QueryEvaluationException

      Description copied from interface: `FederatedService`
      Evaluate the provided SPARQL query at this federated service, possibilities for vectored evaluation.

      Contracts:

      - The original bindings need to be inserted into the result
      - SILENT service must be dealt with in the method

      Compare `SPARQLFederatedService` for a reference implementation

      Specified by:
        `evaluate` in interface `FederatedService`
      Parameters:
        `service` - the reference to the service node, contains information to construct the query
        `bindings` - the bindings serving as additional constraints (for vectored evaluation)
        `baseUri` - the baseUri
      Returns:
        the result of evaluating the query using bindings as constraints, the original bindings need to be inserted into the results!
      Throws:
        `QueryEvaluationException` - If there was an exception generated while evaluating the query.

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.