@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 |
---|---|---|
|
|
The name that should be used for this [[Thing]] when constructing its URL. If not provided, a random one will be generated. |
Defined in#
CreateThingOptions#
Ƭ CreateThingOptions: CreateThingLocalOptions
| CreateThingPersistedOptions
The options you pass to [[createThing]].
To specify the URL for the initialised Thing, pass [[CreateThingPersistedOptions]].
To have the URL determined during the save, pass [[CreateThingLocalOptions]].
Defined in#
CreateThingPersistedOptions#
Ƭ CreateThingPersistedOptions: Object
Pass these options to [[createThing]] to initialise a new [[Thing]] whose URL is already known.
Type declaration#
Name |
Type |
Description |
---|---|---|
|
The URL of the newly created [[Thing]]. |
Defined in#
Functions#
asUrl#
▸ asUrl(thing
, baseUrl
): UrlString
Get the URL to a given [[Thing]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Thing]] you want to obtain the URL from. |
|
|
|
If |
Returns#
Defined in#
▸ asUrl<T
>(thing
): UrlString
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
---|---|
|
|
Returns#
Defined in#
▸ asUrl(thing
, baseUrl
): UrlString
Parameters#
Name |
Type |
---|---|
|
|
|
|
Returns#
Defined in#
createThing#
▸ createThing(options
): ThingPersisted
Initialise a new [[Thing]] in memory with a given URL.
Parameters#
Name |
Type |
Description |
---|---|---|
|
See [[CreateThingPersistedOptions]] for how to specify the new [[Thing]]’s URL. |
Returns#
Defined in#
▸ createThing(options?
): ThingLocal
Initialise a new [[Thing]] in memory.
Parameters#
Name |
Type |
Description |
---|---|---|
|
Optional parameters that affect the final URL of this [[Thing]] when saved. |
Returns#
Defined in#
▸ createThing(options?
): Thing
Parameters#
Name |
Type |
---|---|
|
Returns#
Defined in#
getThing#
▸ getThing(solidDataset
, thingUrl
, options?
): ThingPersisted
| null
Extract Quads with a given Subject from a [[SolidDataset]] into a [[Thing]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[SolidDataset]] to extract the [[Thing]] from. |
|
|
The identifier of the desired [[Thing]] (URL or Blank Node identifier). |
|
|
Not yet implemented. |
Returns#
ThingPersisted
| null
Defined in#
▸ getThing(solidDataset
, thingUrl
, options?
): ThingLocal
| null
Extract Quads with a given Subject from a [[SolidDataset]] into a [[Thing]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[SolidDataset]] to extract the [[Thing]] from. |
|
`https://inrupt.com/.well-known/sdk-local-node/${string}` |
The identifier of the desired [[Thing]] (URL or Blank Node identifier). |
|
|
Not yet implemented. |
Returns#
ThingLocal
| null
Defined in#
▸ getThing(solidDataset
, thingUrl
, options?
): Thing
| null
Extract Quads with a given Subject from a [[SolidDataset]] into a [[Thing]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[SolidDataset]] to extract the [[Thing]] from. |
|
|
The identifier of the desired [[Thing]] (URL or Blank Node identifier). |
|
|
Not yet implemented. |
Returns#
Thing
| null
Defined in#
getThingAll#
▸ getThingAll(solidDataset
, options?
): Thing
[]
Get all [[Thing]]s in a [[SolidDataset]].
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The [[SolidDataset]] to extract the [[Thing]]s from. |
|
|
Not yet implemented. |
Returns#
Thing
[]
Defined in#
isThing#
▸ isThing<X
>(input
): input is Readonly<Object>
Type parameters#
Name |
---|
|
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
An value that might be a [[Thing]]. |
Returns#
input is Readonly<Object>
Whether input
is a Thing.
Since
0.2.0
Defined in#
isThingLocal#
▸ isThingLocal(thing
): thing is ThingLocal
Parameters#
Name |
Type |
Description |
---|---|---|
|
The [[Thing]] of which a URL might or might not be known. |
Returns#
thing is ThingLocal
true
if thing
has no known URL yet.
Since
1.7.0
Defined in#
removeThing#
▸ removeThing<Dataset
>(solidDataset
, thing
): Dataset
& WithChangeLog
Remove a Thing from a SolidDataset.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The SolidDataset to remove a Thing from. |
|
|
The Thing to remove from |
Returns#
Dataset
& WithChangeLog
A new [[SolidDataset]] equal to the input SolidDataset, excluding the given Thing.
Defined in#
setThing#
▸ setThing<Dataset
>(solidDataset
, thing
): Dataset
& WithChangeLog
Insert a [[Thing]] into a [[SolidDataset]], replacing previous instances of that Thing.
Type parameters#
Name |
Type |
---|---|
|
extends |
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The SolidDataset to insert a Thing into. |
|
|
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#
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.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The Thing to get a human-readable representation of. |
Returns#
string
Since
0.3.0