A DataAccessor is the building block closest to the actual data storage. It should not worry about most Solid logic, most of that will be handled before it is called. There are a few things it still needs to do, and it is very important every implementation does this:

  • If the input identifier ends with a slash, it should be assumed the identifier is targeting a container.
  • Similarly, if there is no trailing slash it should assume a document.
  • It should always throw a NotFoundHttpError if it does not have data matching the input identifier.
  • DataAccessors should not generate containment triples. This will be done externally using getChildren.

Hierarchy

  • InMemoryDataAccessor

Implements

Constructors

Properties

identifierStrategy: IdentifierStrategy
store: { entries: Record<string, ContainerEntry> }

Type declaration

  • entries: Record<string, ContainerEntry>

Methods

  • Should throw a NotImplementedHttpError if the DataAccessor does not support storing the given Representation.

    Throws

    BadRequestHttpError If it does not support the incoming data.

    Returns Promise<void>

  • Returns metadata for all resources in the requested container. This should not be all metadata of those resources (but it can be), but instead the main metadata you want to show in situations where all these resources are presented simultaneously. Generally this would be metadata that is present for all of these resources, such as resource type or last modified date.

    It can be safely assumed that the incoming identifier will always correspond to a container.

    Parameters

    Returns AsyncIterableIterator<RepresentationMetadata>