Interface IPatcher

All Known Implementing Classes:
OntologyPatcher

public interface IPatcher
An object to apply KGCL-described changes to a knowledge graph.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    apply(List<Change> changes)
    Applies a changeset to the knowledge graph.
    boolean
    apply(List<Change> changes, boolean noPartialApply)
    Applies a changeset to the knowledge graph.
    boolean
    apply(Change change)
    Applies a single change to the knowledge graph.
    Gets the changes that have been rejected by this patcher.
    boolean
    Indicates whether changes have been rejected by this patcher.
  • Method Details

    • apply

      boolean apply(Change change)
      Applies a single change to the knowledge graph.
      Parameters:
      change - The change to apply.
      Returns:
      true if the change has been successfully applied, or false if the change has been rejected.
    • apply

      default boolean apply(List<Change> changes)
      Applies a changeset to the knowledge graph. This method shall try to apply all changes in the given list. If some changes cannot be applied, they shall be ignored (and a call to getRejectedChanges() shall return the concerned changes), while the remaining changes shall be applied normally.
      Parameters:
      changes - The list of changes to apply.
      Returns:
      true if all changes were applied successfully, otherwise false.
    • apply

      boolean apply(List<Change> changes, boolean noPartialApply)
      Applies a changeset to the knowledge graph.
      Parameters:
      changes - The list of changes to apply.
      noPartialApply - If true, changes shall only be applied if all the changes in the list can be applied; if false, changes that can be applied will be effectively applied, while rejected changes will be ignored.
      Returns:
      true if all changes were applied successfully, otherwise false.
    • hasRejectedChanges

      boolean hasRejectedChanges()
      Indicates whether changes have been rejected by this patcher.
      Returns:
      true if at least one change has ever been rejected in the lifetime of this object, otherwise false.
    • getRejectedChanges

      List<RejectedChange> getRejectedChanges()
      Gets the changes that have been rejected by this patcher.

      A change may be “rejected” if the contents of the knowledge graph does not match what is expected by the change. For example, a change that attempts to modify a node will be rejected if the node does not exist in the knowledge graph.

      Returns:
      A list of all the changes that have been rejected in the lifetime of this patcher.