Interface EntityIdValue

All Superinterfaces:
IriIdentifiedValue, Value
All Known Subinterfaces:
FormIdValue, ItemIdValue, LexemeIdValue, MediaInfoIdValue, PropertyIdValue, SenseIdValue, UnsupportedEntityIdValue
All Known Implementing Classes:
EntityIdValueImpl, FormIdValueImpl, ItemIdValueImpl, LexemeIdValueImpl, MediaInfoIdValueImpl, PropertyIdValueImpl, SenseIdValueImpl, UnsupportedEntityIdValueImpl

public interface EntityIdValue extends IriIdentifiedValue
An entity is a Value that is represented by a page in Wikibase. It is identified by its id, corresponding to the title of that page. Typical entities are Items (with identifiers of the form Q1234) and Properties (with identifiers of the form P1234).

When considering entities from multiple sites, the (local) ID alone is not enough to identify an entity unambiguously. In this case, the site IRI also needs to be taken into account.

An alternative to using the local ID and site IRI together is to use the full IRI. By default, this is computed by appending the local ID to the site IRI. However, for some sites and some entity types, more elaborate computations might be required, so this construction scheme for IRIs should not be presumed.

The full IRI of an entity is used in export formats like RDF, but also internally, e.g., for identifying the calendar model of time values.

Author:
Markus Kroetzsch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    IRI of the type of an entity that is a form.
    static final String
    IRI of the type of an entity that is an item.
    static final String
    IRI of the type of an entity that is a lexeme.
    static final String
    IRI of the type of an entity that is a media info.
    static final String
    IRI of the type of an entity that is a property.
    static final String
    IRI of the type of an entity that is a sense.
    static final String
    IRI of the type of an unsupported entity, when no type could be detected from the JSON representation.
    static final String
    The site IRI of "local" identifiers.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the type of this entity.
    Returns the id of this entity.
    Returns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.
    boolean
    Checks whether this is a placeholder ID.

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

    getIri

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

    accept
  • Field Details

    • ET_ITEM

      static final String ET_ITEM
      IRI of the type of an entity that is an item.
      See Also:
    • ET_PROPERTY

      static final String ET_PROPERTY
      IRI of the type of an entity that is a property.
      See Also:
    • ET_LEXEME

      static final String ET_LEXEME
      IRI of the type of an entity that is a lexeme.
      See Also:
    • ET_FORM

      static final String ET_FORM
      IRI of the type of an entity that is a form.
      See Also:
    • ET_SENSE

      static final String ET_SENSE
      IRI of the type of an entity that is a sense.
      See Also:
    • ET_MEDIA_INFO

      static final String ET_MEDIA_INFO
      IRI of the type of an entity that is a media info.
      See Also:
    • ET_UNSUPPORTED

      static final String ET_UNSUPPORTED
      IRI of the type of an unsupported entity, when no type could be detected from the JSON representation. The IRI for ids associated with type information are constructed using the same format as above.
      See Also:
    • SITE_LOCAL

      static final String SITE_LOCAL
      The site IRI of "local" identifiers. These are used to mark internal ids that are not found on any external site. Components that send data to external services or that create data exports should omit such ids, if possible.
      See Also:
  • Method Details

    • getEntityType

      String getEntityType()
      Returns the type of this entity. This should be an IRI that identifies an entity type, such as ET_ITEM or ET_PROPERTY.
      Returns:
      IRI string to identify the type of the entity
    • getId

      String getId()
      Returns the id of this entity.
      Returns:
      String id of this entity
    • getSiteIri

      String getSiteIri()
      Returns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.
      Returns:
      the site IRI string
    • isPlaceholder

      boolean isPlaceholder()
      Checks whether this is a placeholder ID. Placeholder IDs, for example ItemIdValue.NULL, are often used when creating new entities.
      Returns:
      true if this is a placeholder ID, false otherwise