Class NewEntityLibrary

java.lang.Object
org.openrefine.wikidata.editing.NewEntityLibrary

public class NewEntityLibrary extends Object
This keeps track of the new entities that we have created for each internal reconciliation id.
Author:
Antonin Delpeuch
  • Constructor Details

    • NewEntityLibrary

      public NewEntityLibrary()
    • NewEntityLibrary

      public NewEntityLibrary(Map<Long,String> map)
  • Method Details

    • getId

      public String getId(long id)
      Retrieves the id allocated to a given new cell
      Parameters:
      id - : the fake EntityId generated by the cell
      Returns:
      the id (or null if unallocated yet)
    • setId

      public void setId(long id, String returnedId)
      Stores an id associated to a new cell
      Parameters:
      id - : the internal reconciliation id of the new cell
      returnedId - : the associated id returned by Wikibase
    • updateReconciledCells

      public void updateReconciledCells(Project project, boolean reset)
      Changes the "new" reconciled cells to their allocated ids for later use.
      Parameters:
      reset - : set to true to revert the operation (set cells to "new")
    • getIdMap

      public Map<Long,String> getIdMap()
      Getter, only meant to be used by Jackson
      Returns:
      the underlying map
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object