@inrupt/solid-client / thing/thing

Module: thing/thing#

Classes#

Type Aliases#

CreateThingLocalOptions#

Ƭ CreateThingLocalOptions: Object

Pass these options to createThing to initialise a new Thing whose URL will be determined when it is saved.

Type declaration#

Name

Type

Description

name?

string

The name that should be used for this Thing when constructing its URL. If not provided, a random one will be generated.

Defined in#

src/thing/thing.ts:252


CreateThingOptions#

Ƭ CreateThingOptions: CreateThingLocalOptions | CreateThingPersistedOptions

The options you pass to createThing.

Defined in#

src/thing/thing.ts:271


CreateThingPersistedOptions#

Ƭ CreateThingPersistedOptions: Object

Pass these options to createThing to initialise a new Thing whose URL is already known.

Type declaration#

Name

Type

Description

url

UrlString

The URL of the newly created Thing.

Defined in#

src/thing/thing.ts:261

Functions#

asUrl#

asUrl(thing, baseUrl): UrlString

Get the URL to a given Thing.

Parameters#

Name

Type

Description

thing

ThingLocal

The Thing you want to obtain the URL from.

baseUrl

string

If thing is not persisted yet, the base URL that should be used to construct this Thing’s URL.

Returns#

UrlString

Defined in#

src/thing/thing.ts:333

asUrl<T>(thing): UrlString

Type parameters#

Name

Type

T

extends ThingPersisted

Parameters#

Name

Type

thing

T & IsNotThingLocal<T>

Returns#

UrlString

Defined in#

src/thing/thing.ts:334

asUrl(thing, baseUrl): UrlString

Parameters#

Name

Type

thing

Readonly<{}>

baseUrl

string

Returns#

UrlString

Defined in#

src/thing/thing.ts:337


createThing#

createThing(options): ThingPersisted

Initialise a new Thing in memory with a given URL.

Parameters#

Name

Type

Description

options

CreateThingPersistedOptions

See CreateThingPersistedOptions for how to specify the new Thing’s URL.

Returns#

ThingPersisted

Defined in#

src/thing/thing.ts:279

createThing(options?): ThingLocal

Initialise a new Thing in memory.

Parameters#

Name

Type

Description

options?

CreateThingLocalOptions

Optional parameters that affect the final URL of this Thing when saved.

Returns#

ThingLocal

Defined in#

src/thing/thing.ts:287

createThing(options?): Thing

Parameters#

Name

Type

options?

CreateThingOptions

Returns#

Thing

Defined in#

src/thing/thing.ts:288


getThing#

getThing(solidDataset, thingUrl, options?): ThingPersisted | null

Extract Quads with a given Subject from a SolidDataset into a Thing.

Parameters#

Name

Type

Description

solidDataset

Readonly<{}>

The SolidDataset to extract the Thing from.

thingUrl

string | Url

The URL of the desired Thing.

options?

GetThingOptions

Not yet implemented.

Returns#

ThingPersisted | null

Defined in#

src/thing/thing.ts:69

getThing(solidDataset, thingUrl, options?): ThingLocal | null

Extract Quads with a given Subject from a SolidDataset into a Thing.

Parameters#

Name

Type

Description

solidDataset

Readonly<{}>

The SolidDataset to extract the Thing from.

thingUrl

`https://inrupt.com/.well-known/sdk-local-node/${string}`

The URL of the desired Thing.

options?

GetThingOptions

Not yet implemented.

Returns#

ThingLocal | null

Defined in#

src/thing/thing.ts:74

getThing(solidDataset, thingUrl, options?): Thing | null

Extract Quads with a given Subject from a SolidDataset into a Thing.

Parameters#

Name

Type

Description

solidDataset

Readonly<{}>

The SolidDataset to extract the Thing from.

thingUrl

string | Url

The URL of the desired Thing.

options?

GetThingOptions

Not yet implemented.

Returns#

Thing | null

Defined in#

src/thing/thing.ts:79


getThingAll#

getThingAll(solidDataset, options?): Thing[]

Get all Things in a SolidDataset.

Parameters#

Name

Type

Description

solidDataset

Readonly<{}>

The SolidDataset to extract the Things from.

options

GetThingOptions & { acceptBlankNodes?: boolean }

Not yet implemented.

Returns#

Thing[]

Defined in#

src/thing/thing.ts:123


isThing#

isThing<X>(input): input is Readonly<Object>

Since

0.2.0

Type parameters#

Name

X

Parameters#

Name

Type

Description

input

Readonly<{}> | X

An value that might be a Thing.

Returns#

input is Readonly<Object>

Whether input is a Thing.

Defined in#

src/thing/thing.ts:317


isThingLocal#

isThingLocal(thing): thing is ThingLocal

Since

1.7.0

Parameters#

Name

Type

Description

thing

ThingPersisted | ThingLocal

The Thing of which a URL might or might not be known.

Returns#

thing is ThingLocal

true if thing has no known URL yet.

Defined in#

src/thing/thing.ts:395


removeThing#

removeThing<Dataset>(solidDataset, thing): Dataset & WithChangeLog

Remove a Thing from a SolidDataset.

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

solidDataset

Dataset

The SolidDataset to remove a Thing from.

thing

string | Url | Readonly<{}>

The Thing to remove from solidDataset.

Returns#

Dataset & WithChangeLog

A new SolidDataset equal to the input SolidDataset, excluding the given Thing.

Defined in#

src/thing/thing.ts:204


setThing#

setThing<Dataset>(solidDataset, thing): Dataset & WithChangeLog

Insert a Thing into a SolidDataset, replacing previous instances of that Thing.

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

solidDataset

Dataset

The SolidDataset to insert a Thing into.

thing

Readonly<{}>

The Thing to insert into the given SolidDataset.

Returns#

Dataset & WithChangeLog

A new SolidDataset equal to the given SolidDataset, but with the given Thing.

Defined in#

src/thing/thing.ts:149


thingAsMarkdown#

thingAsMarkdown(thing): string

Gets a human-readable representation of the given Thing to aid debugging.

Note that changes to the exact format of the return value are not considered a breaking change; it is intended to aid in debugging, not as a serialisation method that can be reliably parsed.

Since

0.3.0

Parameters#

Name

Type

Description

thing

Readonly<{}>

The Thing to get a human-readable representation of.

Returns#

string

Defined in#

src/thing/thing.ts:362