Skip to content

@pod-os/core


@pod-os/core / TypeIndex

Class: TypeIndex

Defined in: type-index/TypeIndex.ts:12

Represents a private or public type index document

Since

0.24.0

Extends

Constructors

Constructor

new TypeIndex(uri, store, editable?): TypeIndex

Defined in: type-index/TypeIndex.ts:13

Parameters

uri

string

store

Store

editable?

boolean = false

Returns

TypeIndex

Overrides

Thing.constructor

Properties

editable

readonly editable: boolean

Defined in: thing/Thing.ts:82

Whether the Thing can be edited according to its access control settings

Inherited from

Thing.editable


store

readonly store: Store

Defined in: thing/Thing.ts:78

Inherited from

Thing.store


uri

readonly uri: string

Defined in: thing/Thing.ts:77

Inherited from

Thing.uri

Methods

anyValue()

anyValue(...predicateUris): undefined

Defined in: thing/Thing.ts:219

Returns any value linked from this thing via one of the given predicates

Parameters

predicateUris

...string[]

Returns

undefined

Inherited from

Thing.anyValue


assume()

assume\<T>(SpecificThing): T

Defined in: thing/Thing.ts:406

Call this method to switch to a more specific subclass of Thing.

Type Parameters

T

T

Parameters

SpecificThing

(uri, store, editable) => T

a subclass of Thing to assume

Returns

T

Inherited from

Thing.assume


attachments()

attachments(): Attachment[]

Defined in: thing/Thing.ts:387

Returns all attachments linked to this thing

Returns

Attachment[]

Inherited from

Thing.attachments


container()

container(): object

Defined in: thing/Thing.ts:416

Returns the container that contains this thing's document The container URI is derived from the thing's URI.

Returns

object

uri

uri: string

Inherited from

Thing.container


description()

description(): undefined

Defined in: thing/Thing.ts:286

Returns a literal value that describes this thing. Tries to match common RDF terms used for descriptions, like dct:description, schema:description or rdfs:comment

Returns

undefined

Inherited from

Thing.description


label()

label(): string

Defined in: thing/Thing.ts:96

Returns a human-readable label for this thing. Tries to match common RDF terms used for labels, such as rdfs:label, schema:name and others.

If no such term is present, it will derive a label from the URI.

Returns

string

Inherited from

Thing.label


listAll()

listAll(): TypeRegistration[]

Defined in: type-index/TypeIndex.ts:17

Returns

TypeRegistration[]


literals()

literals(): Literal[]

Defined in: thing/Thing.ts:116

Returns all the literal values that are linked to this thing

Returns

Literal[]

Inherited from

Thing.literals


observeAnyValue()

observeAnyValue(...predicateUris): Observable\<string | undefined>

Defined in: thing/Thing.ts:235

Observe changes in a value linked from this thing via one of the given predicates

Note that return value may differ from that from anyValue when more than one value is present.

Parameters

predicateUris

...string[]

Returns

Observable\<string | undefined>

Inherited from

Thing.observeAnyValue


observeDescription()

observeDescription(): Observable\<string | undefined>

Defined in: thing/Thing.ts:293

Observe changes in literal values that describe this thing. See description

Returns

Observable\<string | undefined>

Inherited from

Thing.observeDescription


observeLabel()

observeLabel(): Observable\<string>

Defined in: thing/Thing.ts:107

Observe changes in human-readable label for this thing. See label.

Returns

Observable\<string>

Inherited from

Thing.observeLabel


observeRelations()

observeRelations(predicate?): Observable\<Relation[]>

Defined in: thing/Thing.ts:153

Observe changes in links from this thing to other resources

Parameters

predicate?

string

Returns

Observable\<Relation[]>

Inherited from

Thing.observeRelations


observeReverseRelations()

observeReverseRelations(predicate?): Observable\<Relation[]>

Defined in: thing/Thing.ts:195

Observe changes in links from other resources to this thing

Parameters

predicate?

string

Returns

Observable\<Relation[]>

Inherited from

Thing.observeReverseRelations


observeTypes()

observeTypes(): Observable\<RdfType[]>

Defined in: thing/Thing.ts:368

Observe changes to the list of RDF types for this thing

Returns

Observable\<RdfType[]>

Inherited from

Thing.observeTypes


picture()

picture(): { url: string; } | null

Defined in: thing/Thing.ts:304

Returns the url of a picture or logo associated with this thing Tries to match common RDF terms used for pictures like schema:image, vcard:photo or foaf:img

Returns

{ url: string; } | null

An object containing the url of the picture

Inherited from

Thing.picture


relations()

relations(predicate?): Relation[]

Defined in: thing/Thing.ts:133

Returns all the unique links from this thing to other resources. This only includes named nodes and excludes rdf:type relations.

Parameters

predicate?

string

Returns

Relation[]

Inherited from

Thing.relations


reverseRelations()

reverseRelations(predicate?): Relation[]

Defined in: thing/Thing.ts:176

Returns all the unique links from other resources to this thing

Parameters

predicate?

string

Returns

Relation[]

Inherited from

Thing.reverseRelations


types()

types(): RdfType[]

Defined in: thing/Thing.ts:357

Retrieves a list of RDF types for this thing.

Returns

RdfType[]

Inherited from

Thing.types