DalApi class provides methods to interact with the Dataspecer backend service. These methods provide a way to retrieve data about data specifications, backend generated artifacts as well as fetching data structure model resources.

Constructors

Methods

  • Performs a call to generate Dataspecer artifacts for all data structure models included in the data specification represented by its IRI identifier.

    Parameters

    • dataSpecificationIri: string

      The IRI of the data specification for which artifacts will be generated.

    Returns Promise<AxiosResponse<Buffer>>

    Backend service response object which contains the ZIP represented as a Buffer object, which contains the generated artifacts.

  • Fetches a data specification representation data from Dataspecer backend service which corresponds to the provided IRI.

    Parameters

    • dataSpecificationIri: string

      The IRI of the data specification to fetch.

    Returns Promise<DataSpecification>

    Promise which, when resolved, returns the fetched DataSpecification instance.

  • Fetches a Resource from the specified dataspecer backend endpoint based on the provided resource IRI.

    Parameters

    • resourceIri: string

      The IRI of the resource to fetch.

    Returns Promise<any>

    A promise that resolves to the data of the fetched resource.

    Throws an error if the resource cannot be fetched.

  • Retrieves a data structure model data for a given structure model included within the data specification.

    Parameters

    • dataSpecificationIri: string
    • structureIri: string

      The IRI identifier of the data structure model within the data specification.

    Returns Promise<DataPsmSchema>

    A promise that resolves to the data structure model representation object - DataPsmSchema instance.

    Throws an error if the specified data structure is not found within the data specification.

    Throws an error when the IRI does not reference any valid data structure model instance.