Package org.openrefine.wikibase.updates
Class StatementEdit
- java.lang.Object
-
- org.openrefine.wikibase.updates.StatementEdit
-
public class StatementEdit extends Object
An object which represents an edit on a statement, which can be added or removed and have various merging strategies with existing statements.- Author:
- Antonin Delpeuch
-
-
Field Summary
Fields Modifier and Type Field Description protected StatementMerger
merger
protected StatementEditingMode
mode
protected org.wikidata.wdtk.datamodel.interfaces.Statement
statement
-
Constructor Summary
Constructors Constructor Description StatementEdit(org.wikidata.wdtk.datamodel.interfaces.Statement statement, StatementEditingMode mode)
Constructs a statement update with a default merging strategy, useful for backwards compatibility (when no merging strategy could be specified).StatementEdit(org.wikidata.wdtk.datamodel.interfaces.Statement statement, StatementMerger merger, StatementEditingMode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
StatementMerger
getMerger()
StatementEditingMode
getMode()
org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue
getPropertyId()
Convenience method to directly access the property of the statement.org.wikidata.wdtk.datamodel.interfaces.Statement
getStatement()
int
hashCode()
String
toString()
StatementEdit
withSubjectId(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue entityId)
Translates the StatementEdit to apply to a new subject id.
-
-
-
Field Detail
-
statement
protected final org.wikidata.wdtk.datamodel.interfaces.Statement statement
-
merger
protected final StatementMerger merger
-
mode
protected final StatementEditingMode mode
-
-
Constructor Detail
-
StatementEdit
public StatementEdit(org.wikidata.wdtk.datamodel.interfaces.Statement statement, StatementMerger merger, StatementEditingMode mode)
-
StatementEdit
public StatementEdit(org.wikidata.wdtk.datamodel.interfaces.Statement statement, StatementEditingMode mode)
Constructs a statement update with a default merging strategy, useful for backwards compatibility (when no merging strategy could be specified).- Parameters:
statement
-mode
-
-
-
Method Detail
-
getStatement
public org.wikidata.wdtk.datamodel.interfaces.Statement getStatement()
-
getMerger
public StatementMerger getMerger()
-
getMode
public StatementEditingMode getMode()
-
withSubjectId
public StatementEdit withSubjectId(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue entityId)
Translates the StatementEdit to apply to a new subject id. This is useful when a statement was planned on an entity which was redirected in the meantime.- Parameters:
entityId
- the new entity id on which the statement should be edited- Returns:
- a copy of the current StatementEdit, just changing the entity id
-
getPropertyId
public org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue getPropertyId()
Convenience method to directly access the property of the statement.
-
-