@inrupt/solid-client / thing/get

Module: thing/get

Functions

getBoolean

getBoolean(thing, property): boolean | null

Returns the boolean value of the specified Property from a Thing. If the Property is not present or its value is not of type boolean, returns null. If the Property has multiple boolean values, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a boolean value from.

property

Url | UrlString

The Property whose boolean value to return.

Returns

boolean | null

A boolean value for the given Property if present, or null if the Property is not present or the value is not of type boolean.


getBooleanAll

getBooleanAll(thing, property): boolean[]

Returns the boolean values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type boolean, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the boolean values from.

property

Url | UrlString

The Property whose boolean values to return.

Returns

boolean[]

An array of boolean values for the given Property.


getDatetime

getDatetime(thing, property): Date | null

Returns the datetime value of the specified Property from a Thing. If the Property is not present or its value is not of type datetime, returns null. If the Property has multiple datetime values, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a datetime value from.

property

Url | UrlString

The Property whose datetime value to return.

Returns

Date | null

A datetime value for the given Property if present, or null if the Property is not present or the value is not of type datetime.


getDatetimeAll

getDatetimeAll(thing, property): Date[]

Returns the datetime values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type datetime, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the datetime values from.

property

Url | UrlString

The Property whose datetime values to return.

Returns

Date[]

An array of datetime values for the given Property.


getDecimal

getDecimal(thing, property): number | null

Returns the decimal value of the specified Property from a Thing. If the Property is not present or its value is not of type decimal, returns null. If the Property has multiple decimal values, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a decimal value from.

property

Url | UrlString

The Property whose decimal value to return.

Returns

number | null

A decimal value for the given Property if present, or null if the Property is not present or the value is not of type decimal.


getDecimalAll

getDecimalAll(thing, property): number[]

Returns the decimal values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type decimal, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the decimal values from.

property

Url | UrlString

The Property whose decimal values to return.

Returns

number[]

An array of decimal values for the given Property.


getInteger

getInteger(thing, property): number | null

Returns the integer value of the specified Property from a Thing. If the Property is not present or its value is not of type integer, returns null. If the Property has multiple integer values, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read an integer value from.

property

Url | UrlString

The Property whose integer value to return.

Returns

number | null

A integer value for the given Property if present, or null if the Property is not present or the value is not of type datetime.


getIntegerAll

getIntegerAll(thing, property): number[]

Returns the integer values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type integer, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the integer values from.

property

Url | UrlString

The Property whose integer values to return.

Returns

number[]

An array of integer values for the given Property.


getStringByLocaleAll

getStringByLocaleAll(thing, property): Map<string, string[]>

Returns all localized string values mapped by the locales for the specified property from the specified Thing (explicitly filters out non-language string literals).

Parameters

Name

Type

Description

thing

Thing

The Thing to read the localised string values from.

property

Url | UrlString

The Property whose localised string values to return.

Returns

Map<string, string[]>

A Map of objects, keyed on locale with the value an array of string values (for that locale).


getStringNoLocale

getStringNoLocale(thing, property): string | null

Returns the string value of the specified Property from a Thing. If the Property is not present or its value is not of type string, returns null. If the Property has multiple string values, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a string value from.

property

Url | UrlString

The Property whose string value to return.

Returns

string | null

A string value for the given Property if present, or null if the Property is not present or the value is not of type string.


getStringNoLocaleAll

getStringNoLocaleAll(thing, property): string[]

Returns the string values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type string, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the string values from.

property

Url | UrlString

The Property whose string values to return.

Returns

string[]

An array of string values for the given Property.


getStringWithLocale

getStringWithLocale(thing, property, locale): string | null

Returns the localized string value of the specified Property from a Thing. If the Property is not present as a string in the specified locale, returns null. If the Property has multiple string values for the specified locale, returns one of its values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a localised string value from.

property

Url | UrlString

The Property whose localised string value to return.

locale

string

The desired locale for the string value.

Returns

string | null

A localised string value for the given Property if present in the specified locale, or null otherwise.


getStringWithLocaleAll

getStringWithLocaleAll(thing, property, locale): string[]

Returns the localized string values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not a string of the specified locale, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the localised string values from.

property

Url | UrlString

The Property whose localised string values to return.

locale

string

The desired locale for the string values.

Returns

string[]

An array of localised string values for the given Property.


getUrl

getUrl(thing, property): UrlString | null

Returns the URL value of the specified Property from a Thing. If the Property is not present or its value is not of type URL, returns null. If the Property has multiple URL values, returns one of its URL values.

Parameters

Name

Type

Description

thing

Thing

The Thing to read a URL value from.

property

Url | UrlString

The Property whose URL value to return.

Returns

UrlString | null

A URL value for the given Property if present, or null if the Property is not present or the value is not of type URL.


getUrlAll

getUrlAll(thing, property): UrlString[]

Returns the URL values of the specified Property from a Thing. If the Property is not present, returns an empty array. If the Property’s value is not of type URL, omits that value in the array.

Parameters

Name

Type

Description

thing

Thing

The Thing to read the URL values from.

property

Url | UrlString

The Property whose URL values to return.

Returns

UrlString[]

An array of URL values for the given Property.