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

    Fields
    Modifier and Type
    Field
    Description
    static final StatementMerger
    Default strategy used in previous versions of the tool, where no strategy could be specified.
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    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.
  • Field Details

    • FORMER_DEFAULT_STRATEGY

      static final StatementMerger 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 entity
      added - 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 entity
      added - the statement to add or remove
      Returns:
      the merged statement obtained out of the two