Skip to main content

StickyMeta

API for Sticky meta. Allows attaching arbitrary metadata on custom entities. Can be applied to a column of entities based on semtype or column tags.

See samples: https://public.datagrok.ai/js/samples/dapi/sticky-meta-tags

Example

var schema = await dapi.stickyMeta.createSchema('test-schema', {name: 'molecule', matchBy: 'semtype=molecule'}, {name: 'prop', type: 'string'});
var metadata = await dapi.stickyMeta.getAllValues(schema, DG.Column.fromList('string', 'key', ['h2o']));

Constructors

new StickyMeta()

new StickyMeta(): StickyMeta

Returns

StickyMeta

Methods

createSchema()

createSchema(name, types, properties): Promise <Schema>

Creates a new schema, which is an instance of sticky meta configuration

Parameters

ParameterTypeDescription
namestringspecifies name of new schema
typesobject[]list of types that schema is applied to. Every type has a name and a matching expression it applies to.
propertiesobject[]list of typed properties that can be stored within the schema

Returns

Promise <Schema>

.

Source

src/sticky_meta.ts:59


deleteSchema()

deleteSchema(id): Promise<void>

Deletes schema by ID

Parameters

ParameterTypeDescription
idstringidentifier of a schema

Returns

Promise<void>

Source

src/sticky_meta.ts:88


getAllValues()

getAllValues(schema, keys): Promise <DataFrame>

Fetches sticky meta values for list of entities.

Parameters

ParameterTypeDescription
schemaSchemaconfiguration of sticky meta to fetch data for.
keysColumn<any>column with identifiers of entities. This column should be configured with tags so type of entity would be recognizable.

Returns

Promise <DataFrame>

, where properties for keys are stored in columns with respective name

Source

src/sticky_meta.ts:47


getSchemas()

getSchemas(): Promise <Schema[]>

Fetch available sticky meta configurations

Returns

Promise <Schema[]>

list of schemas

Source

src/sticky_meta.ts:24


saveSchema()

saveSchema(schema): Promise<void>

Saves modified schema.

Parameters

ParameterTypeDescription
schemaSchemamodified schema

Returns

Promise<void>

Source

src/sticky_meta.ts:80


setAllValues()

setAllValues(schema, keys, values): Promise<void>

Saves sticky meta values for list of entities.

Parameters

ParameterTypeDescription
schemaSchemaa configuration of sticky meta to be applied
keysColumn<any>a column with identifiers of entities. This column should be configured with tags so type of entity would be recognizable.
valuesDataFramea dataframe with metadata values to set. Names of columns in this dataframe should match property names of schema.

Returns

Promise<void>

Source

src/sticky_meta.ts:36