org.eclipse.rdf4j.federated.cache

## Interface SourceSelectionCache

- All Known Implementing Classes:
    SourceSelectionMemoryCache

      public interface SourceSelectionCache

  Describes a cache that can be used for `SourceSelection` to reduce the number of remote requests.
  Author:
    Andreas Schwarte

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `SourceSelectionCache.StatementSourceAssurance`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `SourceSelectionCache.StatementSourceAssurance` | `getAssurance(SubQuery subQuery, Endpoint endpoint)` Ask the cache if a given endpoint can provide results for a `SubQuery`.
    `void` | `updateInformation(SubQuery subQuery, Endpoint endpoint, boolean hasStatements)` Update the information for a given `SubQuery` and `Endpoint`.

- - ### Method Detail

    - #### getAssurance

          SourceSelectionCache.StatementSourceAssurance getAssurance(SubQuery subQuery,
                                                                     Endpoint endpoint)

      Ask the cache if a given endpoint can provide results for a `SubQuery`.

      Implementations may infer information by applying logical rules, e.g. if a cache knows that an endpoint can provide statements {s, foaf:name, "Alan"}, it can also provide results for {s, foaf:name, ?name}.

      If a cache cannot provide information for the given arguments, it must return `SourceSelectionCache.StatementSourceAssurance.POSSIBLY_HAS_STATEMENTS` in order to trigger a remote check.

      Parameters:
        `subQuery` -
        `endpoint` -
      Returns:
        the `SourceSelectionCache.StatementSourceAssurance`

    - #### updateInformation

          void updateInformation(SubQuery subQuery,
                                 Endpoint endpoint,
                                 boolean hasStatements)

      Update the information for a given `SubQuery` and `Endpoint`.

      Implementations must make sure that any operations are thread-safe

      Parameters:
        `subQuery` -
        `endpoint` -
        `hasStatements` -

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