java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ClaimImpl
All Implemented Interfaces:
Claim

public class ClaimImpl extends Object implements Claim
Helper class to represent a Claim. This is a ffacade for a Statement
Author:
Fredo Erxleben, Antonin Delpeuch
  • Constructor Details

    • ClaimImpl

      public ClaimImpl(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
      Constructor to create a claim. This internally creates a new statement, so if you want to create a statement later on just use StatementImpl directly.
      Parameters:
      subject - the subject the Claim refers to
      mainSnak - the main Snak of the Claim
      qualifiers - the qualifiers of the Claim, grouped in SnakGroups
    • ClaimImpl

      public ClaimImpl(StatementImpl statement)
      Constructor used to initialize a claim from a JacksonStatement, should only be used internally.
      Parameters:
      statement - the statement which contains this claim
  • Method Details

    • getSubject

      public EntityIdValue getSubject()
      Description copied from interface: Claim
      The subject that the claim refers to, e.g., the id of "Berlin".
      Specified by:
      getSubject in interface Claim
      Returns:
      EntityId of the subject
    • getMainSnak

      public Snak getMainSnak()
      Description copied from interface: Claim
      Main Snak of the statement. This Snak refers directly to the subject, e.g., the ValueSnak "Population: 3000000".
      Specified by:
      getMainSnak in interface Claim
      Returns:
      the main snak
    • getQualifiers

      public List<SnakGroup> getQualifiers()
      Description copied from interface: Claim
      Groups of auxiliary Snaks, also known as qualifiers, that provide additional context information for this claim. For example, "as of: 2014" might be a temporal context given for a claim that provides a population number. The snaks are grouped by the property that they use.
      Specified by:
      getQualifiers in interface Claim
      Returns:
      list of snak groups
    • getAllQualifiers

      public Iterator<Snak> getAllQualifiers()
      Description copied from interface: Claim
      Returns an iterator over all qualifiers, without considering qualifier groups. The relative order of qualifiers is preserved.
      Specified by:
      getAllQualifiers in interface Claim
      Returns:
      iterator over all qualifier snaks
    • getValue

      public Value getValue()
      Description copied from interface: Claim
      Convenience method to get the value of the claim's main snak, or null if there is none.
      Specified by:
      getValue in interface Claim
      Returns:
      main value of the claim, or null
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object