@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
- computedmetadata
- created
- data
- extra
- fieldmetadata
- hidden
- icon
- id
- last_account_seq
- last_seqid
- metadata
- modified
- origin
- queue
- security
- slug
- summary
- thumbnail
- title
- usermetadata
Methods
- getClassifications
- getExtractedSummaries
- getExtractedTexts
- getFieldData
- getFields
- getFiles
- getNamedEntities
- getParagraphText
- getPositionedNamedEntities
- getSentenceText
- getThumbnails
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
Name | Type |
---|---|
data | IResource |
Inherited from
IResource.constructor
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:48
Properties
computedmetadata
• Optional
computedmetadata: ComputedMetadata
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:10
created
• Optional
created: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:14
data
• data: ResourceData
= {}
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:42
extra
• Optional
extra: ExtraMetadata
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:11
fieldmetadata
• Optional
fieldmetadata: UserFieldMetadata
[]
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:9
hidden
• Optional
hidden: boolean
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:20
icon
• Optional
icon: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:6
id
• id: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:2
last_account_seq
• Optional
last_account_seq: number
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:18
last_seqid
• Optional
last_seqid: number
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:17
metadata
• Optional
metadata: Metadata
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:7
modified
• Optional
modified: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:15
origin
• Optional
origin: Origin
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:12
queue
• Optional
queue: "private"
| "shared"
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:19
security
• Optional
security: Security
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:13
slug
• Optional
slug: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:3
summary
• Optional
summary: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:5
thumbnail
• Optional
thumbnail: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:16
title
• Optional
title: string
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:4
usermetadata
• Optional
usermetadata: UserMetadata
Implementation of
Inherited from
Defined in
libs/sdk-core/src/lib/db/resource/resource.models.ts:8
Methods
getClassifications
▸ getClassifications(): Classification
[]
Returns
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
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:77
getFieldData
▸ getFieldData<T
>(type
, fieldId
): undefined
| T
Type parameters
Name | Type |
---|---|
T | IFieldData |
Parameters
Name | Type |
---|---|
type | keyof ResourceData |
fieldId | string |
Returns
undefined
| T
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:64
getFields
▸ getFields<T
>(types?
): T
[]
Type parameters
Name | Type |
---|---|
T | IFieldData |
Parameters
Name | Type |
---|---|
types | keyof 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
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
Name | Type |
---|---|
fieldType | FIELD_TYPE |
fieldId | string |
paragraph | Paragraph |
Returns
string
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:159
getPositionedNamedEntities
▸ getPositionedNamedEntities(fieldType
, fieldId
): PositionedNER
[]
Parameters
Name | Type |
---|---|
fieldType | keyof ResourceData |
fieldId | string |
Returns
Defined in
libs/sdk-core/src/lib/db/resource/resource.ts:136
getSentenceText
▸ getSentenceText(fieldType
, fieldId
, sentence
): string
Parameters
Name | Type |
---|---|
fieldType | FIELD_TYPE |
fieldId | string |
sentence | Sentence |
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.