Skip to content

Remove assumptions about content-type metadata #341

Closed

Description

@jvherweg

There are some assumptions in the code currently regarding the content-type of metadata and acl files.

https://github.com/solid/community-server/blob/75e4f73c3f3aa08bea97042078272ab5713d3b5e/src/storage/accessors/FileDataAccessor.ts#L166-L168
This function is used to return the file path of the metadata file of the linked identifier. We can't just use the the file mapper to map the identifier and append .meta though. This could potentially give us something like /data$.nq.meta. If the content-type of the resource gets changed to turtle later on it's file would be /data$.ttl but our original metadata would still be at /data$.nq.meta. The current solution causes it to be /data.meta, but does work on the assumption that the file mapper knows that .meta should be interpreted as turtle. We would either need a mapper independent solution to create the correct file path, change the mapper interface, or move the metadata along when the content type changes.

https://github.com/solid/community-server/blob/75e4f73c3f3aa08bea97042078272ab5713d3b5e/src/util/QuadUtil.ts#L22-L23
When serializing or deserializing metadata we always work from the assumption that turtle is used and required. Not sure yet what would be best there.

https://github.com/solid/community-server/blob/f186bece9f0946bb2203d89ae54790ba0b467d0f/src/init/Setup.ts#L63
When creating the root acl resource, we force it to be turtle. We could also create it as a quad stream instead and let the converters inbetween convert it to a supported type (this would then require the system to always have such converters of course).

These do show that we still have certain assumptions in our code, which could be limiting for certain use cases (such as creating a store that only supports n-quads).

Activity

  1. added
    ☀️ enhancement
    on Nov 20, 2020
  2. rubensworks commented on Nov 20, 2020

    @rubensworks
    Contributor

    We would either need a mapper independent solution to create the correct file path, change the mapper interface, or move the metadata along when the content type changes.

    One option would be to have the ability to configure multiple mappers. One specifically for metadata files, and another for "general" usage.
    Perhaps this could be done by regex.

    We could also create it as a quad stream instead and let the converters inbetween convert it to a supported type (this would then require the system to always have such converters of course).

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ☀️ enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions