Interface StatementMerger
- All Known Implementing Classes:
PropertyOnlyStatementMerger,QualifiersStatementMerger,SnakOnlyStatementMerger
public interface StatementMerger
Object which determines how uploaded statements
are matched with existing statements on the edited entity.
- Author:
- Antonin Delpeuch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StatementMergerDefault strategy used in previous versions of the tool, where no strategy could be specified. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatch(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Determines if the existing statement matches the statement to add (or remove)org.wikidata.wdtk.datamodel.interfaces.Statementmerge(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Return the result of merging the statement to add with the existing statement.
-
Field Details
-
FORMER_DEFAULT_STRATEGY
Default strategy used in previous versions of the tool, where no strategy could be specified. TODO make it faithful to what it was before.
-
-
Method Details
-
match
boolean match(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Determines if the existing statement matches the statement to add (or remove)- Parameters:
existing- the statement currently on the entityadded- the statement to add or remove- Returns:
-
merge
org.wikidata.wdtk.datamodel.interfaces.Statement merge(org.wikidata.wdtk.datamodel.interfaces.Statement existing, org.wikidata.wdtk.datamodel.interfaces.Statement added) Return the result of merging the statement to add with the existing statement. This method can assume that the two statements are matching (i.e. the method above has returned true on them).- Parameters:
existing- the statement currently on the entityadded- the statement to add or remove- Returns:
- the merged statement obtained out of the two
-