Class Statement

Constructors

  • Parameters

    • statement: Statement

      the statement in a json format

    Returns Statement

    Example

    const statement = new Statement(json);
    

Properties

_internalID: string = ''

a place to store the internalID so that it does not change if the contents of the object changes

id: undefined | string
mainsnak: Snaks
qualifiers: Snak[]
qualifiersOrder: string[]
rank: "normal" | "preferred" | "deprecated"
references: Reference[]
type: "statement"

Accessors

  • get internalID(): string
  • gets the unique hash of the statement

    Returns string

    the id

  • get property(): undefined | `P${number}`
  • gets the property of the statement

    Returns undefined | `P${number}`

    the property of the statement

    Example

    const property = statement.property;
    

Methods

  • Parameters

    Returns boolean

    if the two statements are equal

    Example

    if (statement1.equals(statement2)) {
    // do something
    }
  • Returns Statement

    the statement in a json format

    Example

    const json = statement.toJson();
    
  • creates a statement from a snak

    Parameters

    • snak: Snak

      the snak for the statement

    Returns Statement

    the statement

    Example

    const statement = Statement.fromSnak(snak);
    

Generated using TypeDoc