@inrupt/solid-client

Globals / “thing/thing”

Module: “thing/thing”

Type aliases

CreateThingLocalOptions

Ƭ CreateThingLocalOptions: { name?: undefined | string }

Defined in src/thing/thing.ts:239

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?

undefined | string

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


CreateThingOptions

Ƭ CreateThingOptions: CreateThingLocalOptions | CreateThingPersistedOptions

Defined in src/thing/thing.ts:258

The options you pass to createThing.


CreateThingPersistedOptions

Ƭ CreateThingPersistedOptions: { url: UrlString }

Defined in src/thing/thing.ts:248

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.

Functions

asUrl

asUrl(thing: ThingLocal, baseUrl: UrlString): UrlString

Defined in src/thing/thing.ts:316

Get the URL to a given Thing.

Parameters:

Name

Type

Description

thing

ThingLocal

The Thing you want to obtain the URL from.

baseUrl

UrlString

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

Returns: UrlString

asUrl(thing: ThingPersisted): UrlString

Defined in src/thing/thing.ts:317

Parameters:

Name

Type

thing

ThingPersisted

Returns: UrlString

asUrl(thing: Thing, baseUrl: UrlString): UrlString

Defined in src/thing/thing.ts:318

Parameters:

Name

Type

thing

Thing

baseUrl

UrlString

Returns: UrlString


createThing

createThing(options: CreateThingPersistedOptions): ThingPersisted

Defined in src/thing/thing.ts:266

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

createThing(options?: CreateThingLocalOptions): ThingLocal

Defined in src/thing/thing.ts:274

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

createThing(options?: CreateThingOptions): Thing

Defined in src/thing/thing.ts:275

Parameters:

Name

Type

options?

CreateThingOptions

Returns: Thing


getThing

getThing(solidDataset: SolidDataset, thingUrl: UrlString | Url, options?: GetThingOptions): ThingPersisted | null

Defined in src/thing/thing.ts:63

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

Parameters:

Name

Type

Description

solidDataset

SolidDataset

The SolidDataset to extract the Thing from.

thingUrl

UrlString | Url

The URL of the desired Thing.

options?

GetThingOptions

Not yet implemented.

Returns: ThingPersisted | null

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

Defined in src/thing/thing.ts:68

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

Parameters:

Name

Type

solidDataset

SolidDataset

thingUrl

LocalNode

options?

GetThingOptions

Returns: ThingLocal | null

getThing(solidDataset: SolidDataset, thingUrl: UrlString | Url | LocalNode, options?: GetThingOptions): Thing | null

Defined in src/thing/thing.ts:73

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

Parameters:

Name

Type

solidDataset

SolidDataset

thingUrl

UrlString | Url | LocalNode

options?

GetThingOptions

Returns: Thing | null


getThingAll

getThingAll(solidDataset: SolidDataset, options?: GetThingOptions): Thing[]

Defined in src/thing/thing.ts:121

Get all Things about which a SolidDataset contains Quads.

Parameters:

Name

Type

Default value

Description

solidDataset

SolidDataset

-

The SolidDataset to extract the Things from.

options

GetThingOptions

{}

Not yet implemented.

Returns: Thing[]


isThing

isThing<X>(input: X | Thing): input is Thing

Defined in src/thing/thing.ts:302

since 0.2.0

Type parameters:

Name

X

Parameters:

Name

Type

Description

input

X | Thing

An value that might be a Thing.

Returns: input is Thing

Whether input is a Thing.


isThingLocal

isThingLocal(thing: ThingPersisted | ThingLocal): thing is ThingLocal

Defined in src/thing/thing.ts:373

Parameters:

Name

Type

Description

thing

ThingPersisted | ThingLocal

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

Returns: thing is ThingLocal

Whether thing has no known URL yet.


removeThing

removeThing<Dataset>(solidDataset: Dataset, thing: UrlString | Url | LocalNode | Thing): Dataset & WithChangeLog

Defined in src/thing/thing.ts:193

Remove a Thing from a SolidDataset.

Type parameters:

Name

Type

Dataset

SolidDataset

Parameters:

Name

Type

Description

solidDataset

Dataset

The SolidDataset to remove a Thing from.

thing

UrlString | Url | LocalNode | Thing

The Thing to remove from solidDataset.

Returns: Dataset & WithChangeLog

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


setThing

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

Defined in src/thing/thing.ts:162

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

Type parameters:

Name

Type

Dataset

SolidDataset

Parameters:

Name

Type

Description

solidDataset

Dataset

The SolidDataset to insert a Thing into.

thing

Thing

The Thing to insert into the given SolidDataset.

Returns: Dataset & WithChangeLog

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


thingAsMarkdown

thingAsMarkdown(thing: Thing): string

Defined in src/thing/thing.ts:343

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

Thing

The Thing to get a human-readable representation of.

Returns: string