Class: Ontologies

appLib/SDKDrivers/xFrameDriver/ontologies.Ontologies

Ontologies repository --- currently not supported

The Ontology class allows the user to manage ontologies.

Hierarchy

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new Ontologies(agent)

Creates an instance of Repository.

Parameters

Name Type
agent PeerAgent

Inherited from

Repository.constructor

Methods

create

create(payload): Promise<APIOntologyV2>

Creates a new ontology.

Example

Copy
Copied
const ontology = await dl.ontologies.create({
    title: 'My ontology',
    projectIds: ['projectId']
})

Parameters

Name Type Description
payload CreateOntologyPayloadV2 The payload of the ontology to be created.

Returns

Promise<APIOntologyV2>

  • A promise that resolves to the created ontology.

Implementation of

IBundle.create


crudReq

crudReq(data): void

Sends a CRUD request to the xFrame.

Parameters

Name Type
data any

Returns

void

Inherited from

Repository.crudReq


crudReqSync

crudReqSync(data, options?): Promise<any>

Sends a CRUD request to the xFrame.

Parameters

Name Type Description
data any The data to send.
options Object
options.timeout? number an option to set the timeout for the request.

Returns

Promise<any>

Inherited from

Repository.crudReqSync


delete

delete(ontologyId): Promise<void>

Deletes an ontology.

Example

Copy
Copied
await dl.ontologies.delete('ontologyId')

Parameters

Name Type Description
ontologyId string The id of the ontology to be deleted.

Returns

Promise<void>

  • A promise that resolves when the ontology is deleted.

Implementation of

IBundle.delete


get

get(ontologyId?): Promise<APIOntologyV2>

Retrieves an ontology.

If no ontology id is provided, the active ontology will be retrieved.

Example

Copy
Copied
const activeOntology = await dl.ontologies.get()

Example

Copy
Copied
const ontology = await dl.ontologies.get('ontologyId')

Parameters

Name Type Description
ontologyId? string The id of the ontology to be retrieved.

Returns

Promise<APIOntologyV2>

  • A promise that resolves to the retrieved ontology.

Implementation of

IBundle.get


query

query(payload?, options?): Promise<IPagedResponse<APIOntologyV2>>

Queries ontologies.

Example

Copy
Copied
const ontologies = await dl.ontologies.query({
   ids: ['ontologyId', 'ontologyId2']
})

Parameters

Name Type Description
payload? OntologyQueryV2 The payload of the query.
options? IQueryOptions The options of the query.

Returns

Promise<IPagedResponse<APIOntologyV2>>

  • A promise that resolves to the queried ontologies.

Implementation of

IBundle.query


update

update(payload): Promise<APIOntologyV2>

Retrieves a list of ontologies.

Example

Copy
Copied
const updatedOntology = await dl.ontologies.update({
   id: 'ontologyId',
   title: 'My updated ontology'
})

Parameters

Name Type Description
payload UpdateOntologyPayloadV2 The payload of the ontology to be updated.

Returns

Promise<APIOntologyV2>

  • A promise that resolves to the updated ontology.

Implementation of

IBundle.update