Snak

WikidataPain. Snak

Parameters:
Name Type Attributes Default Description
snaktype WikidataPain.Snak.ValueType
property Object
datatype WikidataPain.Snak.DataType
datavalue WikidataPain.DataValue <optional>
null

Members

# (static) DataType :string

Type:
  • string

# (static) ValueType :string

Type:
  • string

# datatype :WikidataPain.Snak.DataType

# datavalue :WikidataPain.DataValue

# property :string

Type:
  • string

# snaktype :WikidataPain.Snak.ValueType

Methods

# (static) fromDataValue(property, datatype, datavalue) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
datatype WikidataPain.Snak.DataType
datavalue WikidataPain.DataValue
Returns:
Type
WikidataPain.Snak

# (static) fromEntity(property, entityId) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
entityId string
Returns:
Type
WikidataPain.Snak

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

Parameters:
Name Type Description
property string
languageCode string
text string
Returns:
Type
WikidataPain.Snak

# (static) fromNoValue(property) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
Returns:
Type
WikidataPain.Snak

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

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

# (static) fromQuickStatements(property, value) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
value string
Returns:
Type
WikidataPain.Snak

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

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

# (static) fromSomevalue(property) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
Returns:
Type
WikidataPain.Snak

# (static) fromString(property, string) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
string string
Returns:
Type
WikidataPain.Snak

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

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

# (static) fromTimestamp(property, timestamp) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
timestamp string
Returns:
Type
WikidataPain.Snak

# (static) fromToday(property, precision) → {WikidataPain.Snak}

Parameters:
Name Type Description
property string
precision number
Returns:
Type
WikidataPain.Snak

# comparePrecision(other) → {WikidataPain.PrecisionComparison}

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

# equals(other) → {boolean}

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

# filterByTimeInterval(start, end) → {boolean}

Parameters:
Name Type Description
start Array.<number>
end Array.<number>
Returns:
Type
boolean

# merge(other) → {boolean}

Parameters:
Name Type Description
other WikidataPain.Snak
Returns:
Whether a change occured.
Type
boolean

# toJSON() → {Object}

Returns:
Type
Object

# toString() → {string}

Returns:
Type
string