Package org.openrefine.operations
Interface Operation
-
- All Known Implementing Classes:
AnnotateOneRowOperation
,BlankDownOperation
,CellEditOperation
,ColumnAdditionByFetchingURLsOperation
,ColumnAdditionOperation
,ColumnMoveOperation
,ColumnRemovalOperation
,ColumnRenameOperation
,ColumnReorderOperation
,ColumnSplitOperation
,EngineDependentOperation
,ExpressionBasedOperation
,ExtendDataOperation
,FillDownOperation
,KeyValueColumnizeOperation
,MassEditOperation
,MultiValuedCellJoinOperation
,MultiValuedCellSplitOperation
,PerformWikibaseEditsOperation
,ReconClearSimilarCellsOperation
,ReconCopyAcrossColumnsOperation
,ReconDiscardJudgmentsOperation
,ReconEditOperation
,ReconJudgeSimilarCellsOperation
,ReconMarkNewTopicsOperation
,ReconMatchBestCandidatesOperation
,ReconMatchSpecificTopicOperation
,ReconOperation
,ReconUseValuesAsIdentifiersOperation
,RowFlagOperation
,RowMapOperation
,RowRemovalOperation
,RowReorderOperation
,RowStarOperation
,SaveWikibaseSchemaOperation
,TextTransformOperation
,TransposeColumnsIntoRowsOperation
,TransposeRowsIntoColumnsOperation
,UnknownOperation
public interface Operation
An operation represents one step in a cleaning workflow in Refine. It applies to a single project by via theapply(Grid, ChangeContext)
method. The result of this method is then stored in theHistory
by anHistoryEntry
. Operations only store the metadata for the transformation step. They are required to be serializable and deserializable in JSON with Jackson, and the corresponding JSON object is shown in the JSON export of a workflow. Therefore, the JSON serialization is expected to be stable and deserialization should be backwards-compatible.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ChangeResult
apply(Grid projectState, ChangeContext context)
Derives the new grid state from the current grid state.String
getDescription()
A short human-readable description of what this operation does.default String
getOperationId()
default boolean
isReproducible()
Could this operation be meaningfully re-applied to another project, or is it too specific to the data in this project?
-
-
-
Method Detail
-
apply
ChangeResult apply(Grid projectState, ChangeContext context) throws OperationException
Derives the new grid state from the current grid state. Executing this method should be quick (even on large datasets) since it is expected to just derive the new grid from the existing one without actually executing any expensive computation. Long-running computations should rather go in the derivation of aChangeData
which will be fetched asynchronously.- Parameters:
projectState
- the state of the grid before the change- Returns:
- an object which bundles up various pieces of information produced by the operation: primarily, the new grid after applying the operation. This object can be subclassed to expose more information, which should be serializable with Jackson so that it reaches the frontend.
- Throws:
OperationException
- when the change cannot be applied to the given grid
-
getDescription
String getDescription()
A short human-readable description of what this operation does.
-
isReproducible
default boolean isReproducible()
Could this operation be meaningfully re-applied to another project, or is it too specific to the data in this project? Operations which affect a single row or cell designated by a row index should return false, indicating that they are small fixes that should likely not be part of a reusable pipeline.
-
getOperationId
default String getOperationId()
-
-