DataValue

WikidataPain. DataValue

Parameters:
Name Type Description
type string
value Object

Members

# (static) Type :string

Type:
  • string

# type :WikidataPain.DataValue.Type

# value :Object

Type:
  • Object

Methods

# (static) fromEntity(entityId) → {WikidataPain.DataValue}

Parameters:
Name Type Description
entityId string
Returns:
Type
WikidataPain.DataValue

# (static) fromMonolingualText(languageCode, text) → {WikidataPain.DataValue}

Parameters:
Name Type Description
languageCode string
text string
Returns:
Type
WikidataPain.DataValue

# (static) fromQuantity(amount, precision, unit) → {WikidataPain.DataValue}

Parameters:
Name Type Description
amount string
precision string
unit string
Returns:
Type
WikidataPain.DataValue

# (static) fromRaw(raw) → {WikidataPain.DataValue}

Parameters:
Name Type Description
raw Object
Returns:
Type
WikidataPain.DataValue

# (static) fromString(string) → {WikidataPain.DataValue}

Parameters:
Name Type Description
string string
Returns:
Type
WikidataPain.DataValue

# (static) fromTime(year, monthopt, dayopt) → {WikidataPain.DataValue}

Parameters:
Name Type Attributes Default Description
year number
month number <optional>
null
day number <optional>
null
Returns:
Type
WikidataPain.DataValue

# (static) fromTime(datestring) → {WikidataPain.DataValue}

Parameters:
Name Type Description
datestring number Date string in the format `yyyy-mm-dd`.
Returns:
Type
WikidataPain.DataValue

# (static) fromTimestamp(date) → {WikidataPain.DataValue}

Convert a QuickStatement-date-string to a time-object.
Parameters:
Name Type Description
date string Timestamp in QuickStatement-format.
Returns:
Type
WikidataPain.DataValue

# comparePrecision(other) → {WikidataPain.PrecisionComparison}

Compares the precision of this DataValue with another DataValue's precision.
Parameters:
Name Type Description
other WikidataPain.DataValue DataValue to compare to.

# equals(other) → {boolean}

Compares this DataValue with another DataValue.
Parameters:
Name Type Description
other WikidataPain.DataValue DataValue to compare to.
Returns:
`true` if equal, otherwise `false`.
Type
boolean

# toJSON() → {Object}

Returns:
Type
Object

# toString() → {string}

Returns:
Type
string