Class: Ontologies
repositories.Ontologies
Ontologies repository --- currently not supported
The Ontology class allows the user to manage ontologies.
Hierarchy
-
Repository
↳
Ontologies
Implements
-
IBundle
<APIOntologyV2
>
Table of contents
Constructors
Methods
Constructors
constructor
• new Ontologies(agent
)
Creates an instance of Repository.
Parameters
Name | Type |
---|---|
agent |
PeerAgent |
Inherited from
Methods
create
▸ create(payload
): Promise
<APIOntologyV2
>
Creates a new ontology.
Example
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.
delete
▸ delete(ontologyId
): Promise
<void
>
Deletes an ontology.
Example
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.
get
▸ get(ontologyId?
): Promise
<APIOntologyV2
>
Retrieves an ontology.
If no ontology id is provided, the active ontology will be retrieved.
Example
const activeOntology = await dl.ontologies.get()
Example
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.
query
▸ query(payload?
, options?
): Promise
<IPagedResponse
<APIOntologyV2
>>
Queries ontologies.
Example
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.
update
▸ update(payload
): Promise
<APIOntologyV2
>
Retrieves a list of ontologies.
Example
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.