Package org.incenp.obofoundry.kgcl
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 TypeMethodDescriptiondefault boolean
Applies a changeset to the knowledge graph.boolean
Applies a changeset to the knowledge graph.boolean
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
Applies a single change to the knowledge graph.- Parameters:
change
- The change to apply.- Returns:
true
if the change has been successfully applied, orfalse
if the change has been rejected.
-
apply
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 togetRejectedChanges()
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, otherwisefalse
.
-
apply
Applies a changeset to the knowledge graph.- Parameters:
changes
- The list of changes to apply.noPartialApply
- Iftrue
, changes shall only be applied if all the changes in the list can be applied; iffalse
, changes that can be applied will be effectively applied, while rejected changes will be ignored.- Returns:
true
if all changes were applied successfully, otherwisefalse
.
-
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, otherwisefalse
.
-
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.
-