Interface OntologyBeta

Interface representing ontology operations.

interface Ontology {
    cancelQueries: ((context: string) => Promise<void>);
    clearRelationshipCache: ((entity: Entity, relationship: string | Relationship, inverse?: boolean) => Promise<void>);
    consistentUUID: ((name: string, namespace?: string) => Promise<string>);
    getAvailableOntologies: (() => Promise<string[]>);
    getConceptByName: ((conceptName: string) => Promise<undefined | Concept>);
    getConceptForEntity: ((entity: Entity) => Promise<undefined | Concept>);
    getConceptNames: (() => Promise<string[]>);
    getConcepts: (() => Promise<Map<string, Concept>>);
    getConnectedEntities: (<T>(entity: Entity, relationship: string | Relationship, forceRefresh?: boolean) => Promise<T[]>);
    getConnectionsByType: (<T>(entity: Entity, concept: string, handler?: ((connections: EConnection[]) => Promise<void>)) => Promise<EConnection[]>);
    getEntity: (<T>(e: Entity, refresh?: boolean, skipSideEffects?: boolean) => Promise<T>);
    getOntologyName: (() => Promise<string>);
    getRelationshipCount: ((entity: Entity, rel: string | Relationship, forceRefresh?: boolean) => Promise<RelationshipCountResult>);
    getRelationshipsForEntity: ((entity: Entity) => Promise<Relationship[]>);
    isConcept: ((conceptName: string) => Promise<boolean>);
    sendQuery: ((query: string, options?: SendQueryOptions) => Promise<QueryResponse>);
    sendQueryT: (<T>(query: string, options?: SendQueryOptions, force_refresh?: boolean) => Promise<T[]>);
    subscribe: (<T>(entity: Entity, callback: Callback<T>, skipInitialCallback?: boolean) => Promise<Unsubscribe>);
    updateCache: ((entities: (EntityBase & {
        entity_label: string;
    } & WorkspaceItemModel & {
        os_entity_uid: string;
        os_workspace: string;
    } & OsAuditFields & {
        os_icon?: string;
    } & {
        #os_path?: string;
        os_content_size?: number;
        os_has_attachment?: boolean;
        os_item_content?: any;
        os_item_content_type?: string;
        os_parent_folder?: string;
        os_readonly?: boolean;
    })[]) => Promise<(EntityBase & {
        entity_label: string;
    } & WorkspaceItemModel & {
        os_entity_uid: string;
        os_workspace: string;
    } & OsAuditFields & {
        os_icon?: string;
    } & {
        #os_path?: string;
        os_content_size?: number;
        os_has_attachment?: boolean;
        os_item_content?: any;
        os_item_content_type?: string;
        os_parent_folder?: string;
        os_readonly?: boolean;
    })[]>);
    getSysInheritance(): Promise<Inheritance[]>;
    getWorkspaceRelationshipRecords(entity: Entity, rel: string | Relationship): Promise<WorkspaceRelationship[]>;
}

Properties

cancelQueries: ((context: string) => Promise<void>)

Cancels queries in the given context.

Type declaration

    • (context): Promise<void>
    • Parameters

      • context: string

        The context in which to cancel queries.

      Returns Promise<void>

      A promise that resolves when the operation is complete.

clearRelationshipCache: ((entity: Entity, relationship: string | Relationship, inverse?: boolean) => Promise<void>)

Clears the relationship cache for a given entity and relationship.

Type declaration

    • (entity, relationship, inverse?): Promise<void>
    • Parameters

      • entity: Entity

        The entity for which to clear the cache.

      • relationship: string | Relationship

        The relationship or relationship name.

      • Optionalinverse: boolean

        Whether to clear the inverse relationship cache.

      Returns Promise<void>

      A promise that resolves when the operation is complete.

consistentUUID: ((name: string, namespace?: string) => Promise<string>)

Generates a consistent UUID.

Type declaration

    • (name, namespace?): Promise<string>
    • Parameters

      • name: string

        The name for which to generate the UUID.

      • Optionalnamespace: string

        Optional namespace for the UUID.

      Returns Promise<string>

      A promise that resolves to the UUID.

getAvailableOntologies: (() => Promise<string[]>)

Gets the available ontologies.

Type declaration

    • (): Promise<string[]>
    • Returns Promise<string[]>

      A promise that resolves to an array of available ontology names.

getConceptByName: ((conceptName: string) => Promise<undefined | Concept>)

Gets a concept by its name.

Type declaration

    • (conceptName): Promise<undefined | Concept>
    • Parameters

      • conceptName: string

        The name of the concept.

      Returns Promise<undefined | Concept>

      A promise that resolves to the concept or undefined if not found.

getConceptForEntity: ((entity: Entity) => Promise<undefined | Concept>)

Gets the concept for a given entity.

Type declaration

    • (entity): Promise<undefined | Concept>
    • Parameters

      • entity: Entity

        The entity for which to get the concept.

      Returns Promise<undefined | Concept>

      A promise that resolves to the concept or undefined if not found.

getConceptNames: (() => Promise<string[]>)

Gets the concept names.

Type declaration

    • (): Promise<string[]>
    • Returns Promise<string[]>

      A promise that resolves to an array concept names.

getConcepts: (() => Promise<Map<string, Concept>>)

Gets all concepts.

Type declaration

    • (): Promise<Map<string, Concept>>
    • Returns Promise<Map<string, Concept>>

      A promise that resolves to a map of concept names to concepts.

getConnectedEntities: (<T>(entity: Entity, relationship: string | Relationship, forceRefresh?: boolean) => Promise<T[]>)

Gets connected entities for a given entity and relationship.

Type declaration

    • <T>(entity, relationship, forceRefresh?): Promise<T[]>
    • Type Parameters

      Parameters

      • entity: Entity

        The entity for which to get connected entities.

      • relationship: string | Relationship

        The relationship or relationship name.

      • OptionalforceRefresh: boolean

        Whether to force a refresh of the data.

      Returns Promise<T[]>

      A promise that resolves to an array of connected entities.

getConnectionsByType: (<T>(entity: Entity, concept: string, handler?: ((connections: EConnection[]) => Promise<void>)) => Promise<EConnection[]>)

Gets connections by type for a given entity and concept.

Type declaration

    • <T>(entity, concept, handler?): Promise<EConnection[]>
    • Type Parameters

      Parameters

      • entity: Entity

        The entity for which to get connections.

      • concept: string

        The concept for which to get connections.

      • Optionalhandler: ((connections: EConnection[]) => Promise<void>)
          • (connections): Promise<void>
          • Parameters

            Returns Promise<void>

      Returns Promise<EConnection[]>

      A promise that resolves to an array of connections.

getEntity: (<T>(e: Entity, refresh?: boolean, skipSideEffects?: boolean) => Promise<T>)

Gets an entity.

Type declaration

    • <T>(e, refresh?, skipSideEffects?): Promise<T>
    • Type Parameters

      Parameters

      • e: Entity

        The entity to get.

      • Optionalrefresh: boolean

        Whether to refresh the data.

      • OptionalskipSideEffects: boolean

        Whether to skip side effects.

      Returns Promise<T>

      A promise that resolves to the entity.

getOntologyName: (() => Promise<string>)

Gets the name of the ontology.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

      A promise that resolves to the name of the ontology.

getRelationshipCount: ((entity: Entity, rel: string | Relationship, forceRefresh?: boolean) => Promise<RelationshipCountResult>)

Gets the relationship count for a given entity and relationship.

Type declaration

    • (entity, rel, forceRefresh?): Promise<RelationshipCountResult>
    • Parameters

      • entity: Entity

        The entity for which to get the relationship count.

      • rel: string | Relationship

        The relationship or relationship name.

      • OptionalforceRefresh: boolean

        Whether to force a refresh of the data.

      Returns Promise<RelationshipCountResult>

      A promise that resolves to the relationship count result.

getRelationshipsForEntity: ((entity: Entity) => Promise<Relationship[]>)

Gets the relationships for a given entity.

Type declaration

    • (entity): Promise<Relationship[]>
    • Parameters

      • entity: Entity

        The entity for which to get relationships.

      Returns Promise<Relationship[]>

      A promise that resolves to an array of relationships.

isConcept: ((conceptName: string) => Promise<boolean>)

Checks whether a concept exists.

Type declaration

    • (conceptName): Promise<boolean>
    • Parameters

      • conceptName: string

        The name of the concept.

      Returns Promise<boolean>

      A promise that resolves to a boolean indicating whether the concept exists.

sendQuery: ((query: string, options?: SendQueryOptions) => Promise<QueryResponse>)

Sends a query.

Type declaration

    • (query, options?): Promise<QueryResponse>
    • Parameters

      • query: string

        The query string.

      • Optionaloptions: SendQueryOptions

        Optional options for sending the query.

      Returns Promise<QueryResponse>

      A promise that resolves to the query response.

sendQueryT: (<T>(query: string, options?: SendQueryOptions, force_refresh?: boolean) => Promise<T[]>)

Sends a query with a typed response.

Type declaration

    • <T>(query, options?, force_refresh?): Promise<T[]>
    • Type Parameters

      • T

      Parameters

      • query: string

        The query string.

      • Optionaloptions: SendQueryOptions

        Optional options for sending the query.

      • Optionalforce_refresh: boolean

        Whether to force a refresh of the data.

      Returns Promise<T[]>

      A promise that resolves to an array of results.

subscribe: (<T>(entity: Entity, callback: Callback<T>, skipInitialCallback?: boolean) => Promise<Unsubscribe>)

Subscribes to changes for a given entity.

Type declaration

    • <T>(entity, callback, skipInitialCallback?): Promise<Unsubscribe>
    • Type Parameters

      • T

      Parameters

      • entity: Entity

        The entity to subscribe to.

      • callback: Callback<T>

        The callback to invoke on changes.

      • OptionalskipInitialCallback: boolean

        Whether to skip the initial callback.

      Returns Promise<Unsubscribe>

      A promise that resolves to an unsubscribe function.

updateCache: ((entities: (EntityBase & {
    entity_label: string;
} & WorkspaceItemModel & {
    os_entity_uid: string;
    os_workspace: string;
} & OsAuditFields & {
    os_icon?: string;
} & {
    #os_path?: string;
    os_content_size?: number;
    os_has_attachment?: boolean;
    os_item_content?: any;
    os_item_content_type?: string;
    os_parent_folder?: string;
    os_readonly?: boolean;
})[]) => Promise<(EntityBase & {
    entity_label: string;
} & WorkspaceItemModel & {
    os_entity_uid: string;
    os_workspace: string;
} & OsAuditFields & {
    os_icon?: string;
} & {
    #os_path?: string;
    os_content_size?: number;
    os_has_attachment?: boolean;
    os_item_content?: any;
    os_item_content_type?: string;
    os_parent_folder?: string;
    os_readonly?: boolean;
})[]>)

Updates the cache with the given entities.

Type declaration

    • (entities): Promise<(EntityBase & {
          entity_label: string;
      } & WorkspaceItemModel & {
          os_entity_uid: string;
          os_workspace: string;
      } & OsAuditFields & {
          os_icon?: string;
      } & {
          #os_path?: string;
          os_content_size?: number;
          os_has_attachment?: boolean;
          os_item_content?: any;
          os_item_content_type?: string;
          os_parent_folder?: string;
          os_readonly?: boolean;
      })[]>
    • Parameters

      • entities: (EntityBase & {
            entity_label: string;
        } & WorkspaceItemModel & {
            os_entity_uid: string;
            os_workspace: string;
        } & OsAuditFields & {
            os_icon?: string;
        } & {
            #os_path?: string;
            os_content_size?: number;
            os_has_attachment?: boolean;
            os_item_content?: any;
            os_item_content_type?: string;
            os_parent_folder?: string;
            os_readonly?: boolean;
        })[]

        The entities to update in the cache.

      Returns Promise<(EntityBase & {
          entity_label: string;
      } & WorkspaceItemModel & {
          os_entity_uid: string;
          os_workspace: string;
      } & OsAuditFields & {
          os_icon?: string;
      } & {
          #os_path?: string;
          os_content_size?: number;
          os_has_attachment?: boolean;
          os_item_content?: any;
          os_item_content_type?: string;
          os_parent_folder?: string;
          os_readonly?: boolean;
      })[]>

      A promise that resolves to the updated entities.

Methods

  • Beta

    Gets the system inheritance.

    Returns Promise<Inheritance[]>

    A promise that resolves to an array of inheritances.

  • Beta

    Gets workspace relationship records for a given entity and relationship.

    Parameters

    • entity: Entity

      The entity for which to get relationship records.

    • rel: string | Relationship

      The relationship or relationship name.

    Returns Promise<WorkspaceRelationship[]>

    A promise that resolves to an array of workspace relationships.