@inrupt/solid-client / thing/get

Module: thing/get

Table of contents

Functions

Functions

getBoolean

getBoolean(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:99


getBooleanAll

getBooleanAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:126


getDatetime

getDatetime(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:151


getDatetimeAll

getDatetimeAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:178


getDecimal

getDecimal(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:203


getDecimalAll

getDecimalAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:230


getInteger

getInteger(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:255


getIntegerAll

getIntegerAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:282


getStringByLocaleAll

getStringByLocaleAll(thing: Thing, property: Url | UrlString): 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).

Defined in: src/thing/get.ts:356


getStringNoLocale

getStringNoLocale(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:388


getStringNoLocaleAll

getStringNoLocaleAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:411


getStringWithLocale

getStringWithLocale(thing: Thing, property: Url | UrlString, locale: string): 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.

Defined in: src/thing/get.ts:308


getStringWithLocaleAll

getStringWithLocaleAll(thing: Thing, property: Url | UrlString, locale: string): 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.

Defined in: src/thing/get.ts:335


getUrl

getUrl(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:49


getUrlAll

getUrlAll(thing: Thing, property: Url | UrlString): 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.

Defined in: src/thing/get.ts:76