org.eclipse.rdf4j.federated.util

## Class FedXUtil

- java.lang.Object
- - org.eclipse.rdf4j.federated.util.FedXUtil

-     public class FedXUtil
      extends Object

  General utility functions
  Since:
    5.0
  Author:
    Andreas Schwarte

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FedXUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `applyMaxQueryExecutionTime(Operation operation, FederationContext federationContext)` Set a maximum execution time corresponding to `FedXConfig.getEnforceMaxQueryTime()` to this operation.
    `static void` | `applyQueryBindings(SailQuery query)` Apply query bindings to transfer information from the query into the evaluation routine, e.g.
    `static String` | `getIncrementalUUID()` Hexadecimal representation of an incremental integer.
    `static IRI` | `iri(String iri)`
    `static Literal` | `literal(String literal)`
    `static Resource[]` | `toContexts(Dataset ds)` Convert the given `Dataset` to an array of contexts
    `static Resource[]` | `toContexts(StatementPattern stmt, Dataset dataset)` Retrieve the contexts from the `StatementPattern` and `Dataset`.
    `static Dataset` | `toDataset(Resource[] contexts)` Convert the given contexts to a `Dataset` representation.
    `static Dataset` | `toDataset(StatementPattern stmt, Dataset dataset)` Returns a `Dataset` representation of the given `StatementPattern` and `Dataset`.
    `static ValueFactory` | `valueFactory()`

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

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

- - ### Constructor Detail

    - #### FedXUtil

          public FedXUtil()

  - ### Method Detail

    - #### iri

          public static IRI iri(String iri)

      Parameters:
        `iri` -
      Returns:
        the IRI for the full URI string

    - #### literal

          public static Literal literal(String literal)

      Parameters:
        `literal` -
      Returns:
        the string literal

    - #### valueFactory

          public static ValueFactory valueFactory()

      Returns:
        a `SimpleValueFactory` instance

    - #### applyQueryBindings

          public static void applyQueryBindings(SailQuery query)

      Apply query bindings to transfer information from the query into the evaluation routine, e.g. the query execution time.
      Parameters:
        `query` -

    - #### getIncrementalUUID

          public static String getIncrementalUUID()

      Hexadecimal representation of an incremental integer.
      Returns:
        an incremental hex UUID

    - #### applyMaxQueryExecutionTime

          public static void applyMaxQueryExecutionTime(Operation operation,
                                                        FederationContext federationContext)

      Set a maximum execution time corresponding to `FedXConfig.getEnforceMaxQueryTime()` to this operation. Note that this is an upper bound only as FedX applies other means for evaluation the maximum query execution time.
      Parameters:
        `operation` - the `Operation`
        `federationContext` - the `FederationContext`

    - #### toDataset

          public static Dataset toDataset(Resource[] contexts)

      Convert the given contexts to a `Dataset` representation.
      Parameters:
        `contexts` -
      Returns:

    - #### toContexts

          public static Resource[] toContexts(Dataset ds)

      Convert the given `Dataset` to an array of contexts
      Parameters:
        `ds` -
      Returns:

    - #### toContexts

          public static Resource[] toContexts(StatementPattern stmt,
                                              Dataset dataset)

      Retrieve the contexts from the `StatementPattern` and `Dataset`.
      Parameters:
        `stmt` -
        `dataset` -
      Returns:

    - #### toDataset

          public static Dataset toDataset(StatementPattern stmt,
                                          Dataset dataset)

      Returns a `Dataset` representation of the given `StatementPattern` and `Dataset`.

      If the `StatementPattern` does not have a context value, the `Dataset` is returned as-is, which may also be `null`.

      Otherwise the newly constructed `Dataset` contains all information from the original one plus the context from the statement.

      Parameters:
        `stmt` -
        `dataset` -
      Returns:

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