Interface Reference

All Known Implementing Classes:
ReferenceImpl

public interface Reference
An interface for references in Wikidata. A reference is currently defined by a list of ValueSnaks, encoding property-value pairs.
Author:
Markus Kroetzsch
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an interator over all snaks, without considering snak groups.
    Wikibase calculates a hash for each reference based on the content of the reference.
    Get the list of snak groups associated with this reference.
  • Method Details

    • getSnakGroups

      List<SnakGroup> getSnakGroups()
      Get the list of snak groups associated with this reference. Objects of this class are immutable, and the list should therefore not be modifiable.
      Returns:
      list of SnakGroups
    • getAllSnaks

      Iterator<Snak> getAllSnaks()
      Returns an interator over all snaks, without considering snak groups. The relative order of snaks is preserved.
      Returns:
      iterator of snaks
    • getHash

      String getHash()
      Wikibase calculates a hash for each reference based on the content of the reference. This hash appears in the RDF serialization of the reference. Since the calculation is hard to reproduce, this is only available if the reference was read from a dump that contains the hash.
      Returns:
      the hash of the reference, if available, otherwise null.