Skip to main content

@nuclia/core / Exports / ReadableResource

Class: ReadableResource

Implements all the read operations on resources.

A resource allows you to store content in the Knowledge Box. A single resource might contain several fields.

Fields have different types: files, links, texts, conversations, etc.

Hierarchy

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ReadableResource(data)

Note: Usually you will not need to create a Resource object yourself. It is returned by the getResource method of the KnowledgeBox object.

Parameters

NameType
dataIResource

Inherited from

IResource.constructor

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:48

Properties

computedmetadata

Optional computedmetadata: ComputedMetadata

Implementation of

IResource.computedmetadata

Inherited from

IResource.computedmetadata

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:10


created

Optional created: string

Implementation of

IResource.created

Inherited from

IResource.created

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:14


data

data: ResourceData = {}

Implementation of

IResource.data

Inherited from

IResource.data

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:42


extra

Optional extra: ExtraMetadata

Implementation of

IResource.extra

Inherited from

IResource.extra

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:11


fieldmetadata

Optional fieldmetadata: UserFieldMetadata[]

Implementation of

IResource.fieldmetadata

Inherited from

IResource.fieldmetadata

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:9


hidden

Optional hidden: boolean

Implementation of

IResource.hidden

Inherited from

IResource.hidden

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:20


icon

Optional icon: string

Implementation of

IResource.icon

Inherited from

IResource.icon

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:6


id

id: string

Implementation of

IResource.id

Inherited from

IResource.id

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:2


last_account_seq

Optional last_account_seq: number

Implementation of

IResource.last_account_seq

Inherited from

IResource.last_account_seq

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:18


last_seqid

Optional last_seqid: number

Implementation of

IResource.last_seqid

Inherited from

IResource.last_seqid

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:17


metadata

Optional metadata: Metadata

Implementation of

IResource.metadata

Inherited from

IResource.metadata

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:7


modified

Optional modified: string

Implementation of

IResource.modified

Inherited from

IResource.modified

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:15


origin

Optional origin: Origin

Implementation of

IResource.origin

Inherited from

IResource.origin

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:12


queue

Optional queue: "private" | "shared"

Implementation of

IResource.queue

Inherited from

IResource.queue

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:19


security

Optional security: Security

Implementation of

IResource.security

Inherited from

IResource.security

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:13


slug

Optional slug: string

Implementation of

IResource.slug

Inherited from

IResource.slug

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:3


summary

Optional summary: string

Implementation of

IResource.summary

Inherited from

IResource.summary

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:5


thumbnail

Optional thumbnail: string

Implementation of

IResource.thumbnail

Inherited from

IResource.thumbnail

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:16


title

Optional title: string

Implementation of

IResource.title

Inherited from

IResource.title

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:4


usermetadata

Optional usermetadata: UserMetadata

Implementation of

IResource.usermetadata

Inherited from

IResource.usermetadata

Defined in

libs/sdk-core/src/lib/db/resource/resource.models.ts:8

Methods

getClassifications

getClassifications(): Classification[]

Returns

Classification[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:119


getExtractedSummaries

getExtractedSummaries(): string[]

Returns the summaries generated by Nuclia for every resource fields.

Returns

string[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:70


getExtractedTexts

getExtractedTexts(): ExtractedText[]

Returns the texts generated by Nuclia for every resource fields.

Returns

ExtractedText[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:77


getFieldData

getFieldData<T>(type, fieldId): undefined | T

Type parameters

NameType
TIFieldData

Parameters

NameType
typekeyof ResourceData
fieldIdstring

Returns

undefined | T

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:64


getFields

getFields<T>(types?): T[]

Type parameters

NameType
TIFieldData

Parameters

NameType
typeskeyof ResourceData[]

Returns

T[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:55


getFiles

getFiles(): CloudLink[]

Returns the files contained in the resource.

Returns

CloudLink[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:84


getNamedEntities

getNamedEntities(): Object

Returns the entities extracted from the resource.

Returns

Object

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:99


getParagraphText

getParagraphText(fieldType, fieldId, paragraph): string

Parameters

NameType
fieldTypeFIELD_TYPE
fieldIdstring
paragraphParagraph

Returns

string

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:159


getPositionedNamedEntities

getPositionedNamedEntities(fieldType, fieldId): PositionedNER[]

Parameters

NameType
fieldTypekeyof ResourceData
fieldIdstring

Returns

PositionedNER[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:136


getSentenceText

getSentenceText(fieldType, fieldId, sentence): string

Parameters

NameType
fieldTypeFIELD_TYPE
fieldIdstring
sentenceSentence

Returns

string

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:163


getThumbnails

getThumbnails(): CloudLink[]

Returns the thumbnails generated by Nuclia for every resource fields.

Returns

CloudLink[]

Defined in

libs/sdk-core/src/lib/db/resource/resource.ts:91