@pod-os/core / Thing
Class: Thing
Defined in: src/thing/Thing.ts:76
Extended by
Constructors
Constructor
new Thing(
uri,store,editable?):Thing
Defined in: src/thing/Thing.ts:84
Parameters
uri
string
store
editable?
boolean = false
Returns
Thing
Properties
editable
readonlyeditable:boolean
Defined in: src/thing/Thing.ts:82
Whether the Thing can be edited according to its access control settings
store
readonlystore:Store
Defined in: src/thing/Thing.ts:78
uri
readonlyuri:string
Defined in: src/thing/Thing.ts:77
Methods
anyValue()
anyValue(...
predicateUris):undefined
Defined in: src/thing/Thing.ts:283
Returns any value linked from this thing via one of the given predicates
Parameters
predicateUris
...string[]
Returns
undefined
assume()
assume\<
T>(SpecificThing):T
Defined in: src/thing/Thing.ts:470
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
attachments()
attachments():
Attachment[]
Defined in: src/thing/Thing.ts:451
Returns all attachments linked to this thing
Returns
container()
container():
object
Defined in: src/thing/Thing.ts:480
Returns the container that contains this thing's document The container URI is derived from the thing's URI.
Returns
object
uri
uri:
string
description()
description():
undefined
Defined in: src/thing/Thing.ts:350
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
label()
label():
string
Defined in: src/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
literals()
literals():
Literal[]
Defined in: src/thing/Thing.ts:116
Returns all the literal values that are linked to this thing
Returns
Literal[]
observeAnyValue()
observeAnyValue(...
predicateUris):Observable\<string|undefined>
Defined in: src/thing/Thing.ts:299
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>
observeDescription()
observeDescription():
Observable\<string|undefined>
Defined in: src/thing/Thing.ts:357
Observe changes in literal values that describe this thing. See description
Returns
Observable\<string | undefined>
observeLabel()
observeLabel():
Observable\<string>
Defined in: src/thing/Thing.ts:107
Observe changes in human-readable label for this thing. See label.
Returns
Observable\<string>
observeLiterals()
observeLiterals():
Observable\<Literal[]>
Defined in: src/thing/Thing.ts:133
Observe changes in literal values linked to this thing
Returns
Observable\<Literal[]>
observeRelations()
observeRelations(
predicate?):Observable\<Relation[]>
Defined in: src/thing/Thing.ts:170
Observe changes in links from this thing to other resources
Parameters
predicate?
string
Returns
Observable\<Relation[]>
observeReverseRelations()
observeReverseRelations(
predicate?):Observable\<Relation[]>
Defined in: src/thing/Thing.ts:266
Observe changes in links from other resources to this thing
Parameters
predicate?
string
Returns
Observable\<Relation[]>
observeTypes()
observeTypes():
Observable\<RdfType[]>
Defined in: src/thing/Thing.ts:432
Observe changes to the list of RDF types for this thing
Returns
Observable\<RdfType[]>
picture()
picture(): {
url:string; } |null
Defined in: src/thing/Thing.ts:368
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
rdfDocument()
rdfDocument():
string|undefined
Defined in: src/thing/Thing.ts:489
Returns
string | undefined
relations()
relations(
predicate?):Relation[]
Defined in: src/thing/Thing.ts:150
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[]
reverseRelations()
reverseRelations(
predicate?):Relation[]
Defined in: src/thing/Thing.ts:247
Returns all the unique links from other resources to this thing
Parameters
predicate?
string
Returns
Relation[]
types()
types():
RdfType[]
Defined in: src/thing/Thing.ts:421
Retrieves a list of RDF types for this thing.
Returns
RdfType[]