Class GraphUpdateStatementSource

java.lang.Object
com.complexible.common.rdf.DelegatingStatementSource
com.complexible.common.rdf.GraphUpdateStatementSource
All Implemented Interfaces:
ContextCopyStatementSource, StatementSource, Closeable, AutoCloseable

public final class GraphUpdateStatementSource extends DelegatingStatementSource implements ContextCopyStatementSource

StatementSource that carries a GraphUpdateChange for a graph-level MOVE/COPY/ADD. The RDF index describes the operation entirely by the GraphUpdateChange and does an ID-level context copy, so it never reads these statements. A connectable that must reindex the moved data (e.g. the search index when a context filter is crossed) can instead iterate the delegate — the source graph's statements, captured before a MOVE clears it — when hasSource() is true. When no data is carried (e.g. a record reconstructed from the tx log on replay) hasSource() is false and such a connectable falls back to a full rebuild.

It implements ContextCopyStatementSource (source graph via getSourceContext(), target via getContext()) so existing context-to-context copy handling continues to apply.

Since:
12.0
Version:
12.0
Author:
Simon Gratzer
  • Constructor Details

  • Method Details

    • cancelCheck

      public CancelCheck cancelCheck()
      Returns:
      the check of the process which asked for this update, or CancelCheck.DUMMY if it did not come from one (replay, replication)
    • graphUpdate

      public GraphUpdateChange graphUpdate()
      Returns the graph-level change this source represents.
    • hasSource

      public boolean hasSource()
      Whether the source graph's statements are carried on this change (so a connectable can reindex the moved data without a full rebuild). false when the change carries no data (e.g. reconstructed from the tx log).
    • getContext

      public Resource getContext()
      Return the context these statements belong to. When non-null, this should override the context specified on the statements themselves.
      Specified by:
      getContext in interface StatementSource
      Overrides:
      getContext in class DelegatingStatementSource
      Returns:
      the context of all the statements from this source, or `null` if there is no context (for all of them) or they each have their own context specified.
    • getSourceContext

      public Resource getSourceContext()
      Specified by:
      getSourceContext in interface ContextCopyStatementSource