Abstract base class for providing schema-related functionalities in the Dataspecer application.

This class serves as a foundation for schema providers, offering methods to retrieve schema artifacts and handle schema files for specific aggregates. It interacts with a remote server to fetch the necessary data and processes it to extract schema information.

Hierarchy (View Summary)

Implements

Constructors

Properties

_api: default
_dataSpecificationIri: string

Methods

  • Retrieves schema files for the structure models defined within a data specification and navigates to the subdirectory which contains the schemas for a specified aggregate. Currently, the schemas are provided by Dataspecer backend service.

    Parameters

    • aggregate: AggregateMetadata

      The metadata for an aggregate for which the schemas should be retrieved.

    Returns Promise<JSZip>

    A promise that resolves to a JSZip object containing the schemas for the specified aggregate.

    Throws an error if the Dataspecer backend service response is not valid or if the requested schemas are missing in the zip archive.

  • Generates a layer artifact which contains the data schema for the specified aggregate. This instance generates an artifact which contains the LDkit schema of the aggregate.

    Parameters

    • file: JSZipObject

      The JSZipObject representing the file to be processed.

    • aggregate: AggregateMetadata

      The aggregate metadata for which the schema is being generated.

    Returns Promise<LayerArtifact>

    A promise that resolves to a LayerArtifact containing the schema details.