Class ReconEntityIdValue

java.lang.Object
org.openrefine.wikidata.schema.entityvalues.ReconEntityIdValue
All Implemented Interfaces:
PrefetchedEntityIdValue, org.wikidata.wdtk.datamodel.interfaces.EntityIdValue, org.wikidata.wdtk.datamodel.interfaces.IriIdentifiedValue, org.wikidata.wdtk.datamodel.interfaces.Value
Direct Known Subclasses:
ReconItemIdValue, ReconMediaInfoIdValue, ReconPropertyIdValue

public abstract class ReconEntityIdValue extends Object implements PrefetchedEntityIdValue
An EntityIdValue that holds not just the id but also the label as fetched by either the reconciliation interface or the suggester and its type, both stored as reconciliation candidates. This label will be localized depending on the language chosen by the user for OpenRefine's interface. Storing it lets us reuse it later on without having to re-fetch it. Storing the types also lets us perform some constraint checks without re-fetching the types of many entities.
Author:
Antonin Delpeuch
  • Field Summary

    Fields inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue

    ET_FORM, ET_ITEM, ET_LEXEME, ET_MEDIA_INFO, ET_PROPERTY, ET_SENSE, ET_UNSUPPORTED, SITE_LOCAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReconEntityIdValue(Recon match, String cellValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    accept(org.wikidata.wdtk.datamodel.interfaces.ValueVisitor<T> valueVisitor)
     
    boolean
    equals(Object other)
     
    abstract String
     
    Returns the id of the reconciled entity
     
    This should return the label "as we got it", with no guarantee that it is current or that its language matches that of the user.
    Returns the reconciliation object corresponding to this entity.
    long
    Returns the integer used internally in OpenRefine to identify the new entity.
     
    Returns a list of types for this entity.
    int
     
    boolean
     
    boolean
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue

    isPlaceholder
  • Constructor Details

    • ReconEntityIdValue

      public ReconEntityIdValue(Recon match, String cellValue)
  • Method Details

    • isMatched

      public boolean isMatched()
    • isNew

      public boolean isNew()
    • getLabel

      public String getLabel()
      Description copied from interface: PrefetchedEntityIdValue
      This should return the label "as we got it", with no guarantee that it is current or that its language matches that of the user. In general though, that should be the case if the user always uses OpenRefine with the same language settings.
      Specified by:
      getLabel in interface PrefetchedEntityIdValue
      Returns:
      the preferred label of the entity
    • getTypes

      public List<String> getTypes()
      Description copied from interface: PrefetchedEntityIdValue
      Returns a list of types for this entity. Again these are the types as they were originally fetched from the reconciliation interface: they can diverge from what is currently on the entity. Empty lists should be returned for
      Specified by:
      getTypes in interface PrefetchedEntityIdValue
    • getEntityType

      public abstract String getEntityType()
      Specified by:
      getEntityType in interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
    • getReconInternalId

      public long getReconInternalId()
      Returns the integer used internally in OpenRefine to identify the new entity.
      Returns:
      the reconciliation id of the reconciled cell
    • getRecon

      public Recon getRecon()
      Returns the reconciliation object corresponding to this entity.
      Returns:
      the full reconciliation metadata of the corresponding cell
    • getId

      public String getId()
      Returns the id of the reconciled entity
      Specified by:
      getId in interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
    • getSiteIri

      public String getSiteIri()
      Specified by:
      getSiteIri in interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
    • getIri

      public String getIri()
      Specified by:
      getIri in interface org.wikidata.wdtk.datamodel.interfaces.IriIdentifiedValue
    • accept

      public <T> T accept(org.wikidata.wdtk.datamodel.interfaces.ValueVisitor<T> valueVisitor)
      Specified by:
      accept in interface org.wikidata.wdtk.datamodel.interfaces.Value
    • 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