You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose all required fields in container listings for the filesystem backend #1207
rdf:type with http://www.w3.org/ns/iana/media-types/{+iana-media-type}#Resource
The iana type could be deduced based on the content type somewhere.
That is only for the FileDataAccessor though. If those are mandatory, we either should define in the DataAccessor interface that those values need to be returned, or that behaviour should be pulled to a higher level. One problem there is that stat:size doesn't really make sense in the memory/sparql data accessor. Do we just return a random number there? We will also have to store the modified date in the memory/sparql data accessor then.
Note that currently DataAccessors are fully responsible for the metadata returned when you request all container children, through the getChildren function.
The iana type I see multiple potential issues with, and we will have to make sure we have a consistent design here. Which type exactly is returned here? Is it the type that the resource was originally stored with, or is it the type deduced through content negotiation? The first is possible for the file and memory data accessor, but in the case of the sparql data accessor this is completely lost. So there we would return internal/quads as types which would result in an invalid iana type. On the other hand, deducing the type based on the accept header to the container request also doesn't make sense in case the container contains resources of differing non-RDF types.
Then it already works for files. We can then create another issue to make it work for other back-ends if desired.
I do admit that I did miss this line, in case we just want a hotfix to make it only work for files we should probably rename the issue and move the other discussion elsewhere.
changed the title [-]Expose all required fields in container listings[/-][+]Expose all required fields in container listings for the filesystem backend[/+]on Mar 9, 2022
in case we just want a hotfix to make it only work for files we should probably rename the issue and move the other discussion elsewhere.
Renamed. Note there there currently is a "hotfix" for files; it just does not return all metadata.
I think we can just fix it for files, and then have a more generic discussion about the accessor architecture. There are several bits that we can reuse more flexibly.
The iana type I see multiple potential issues with, and we will have to make sure we have a consistent design here. Which type exactly is returned here? Is it the type that the resource was originally stored with, or is it the type deduced through content negotiation?
Renamed. Note there there currently is a "hotfix" for files; it just does not return all metadata.
Just as a historical explanation: it's not that there really was a hotfix, it's more that it was never really well defined what metadata should be returned when GETting a container, so every DataAccessor was fully free to choose there. The FileDataAccessor just happened to make the choice that was the closest to what is needed now 😄.
I agree that we can make the file backend more correct for now, as it will only require 1 extra line just to add the iana type, but after that we will need to have that discussion indeed.
I think this is related but I may be wrong. If not I shall create an other issue
When using the latest community-server-recipes with mashlib (from main) for each resourcefile, a resourcefile.meta is created containing a triple describing resourcefile length.
Removing this resourcefile.meta apparently do no harm.
When using the latest community-server-recipes with mashlib (from main) for each resourcefile, a resourcefile.meta is created containing a triple describing resourcefile length.
ResponseMetadata is specifically used for metadata that was generated as part of a response, and should not be stored in a resource. The ones above are generated on a higher level and should be stored. It's just that the file data accessor stores them by how the file system works, but the other data accessors store those as actual metadata.
Potentially that we need to rethink some things there after the metadata PR is finished.
Activity
RubenVerborgh commentedon Mar 8, 2022
A simple way is to update https://github.com/solid/community-server/blob/982d57e1d2812925b09353445a318d067a242943/src/storage/accessors/FileDataAccessor.ts#L313 such that the above metadata is written. It already has
stats.msizeandstat:mtime, so just needs the other two, for which the code is here: https://github.com/RubenVerborgh/solid-metadata-extender/blob/e1e0fccb4c089105778d8a62e5e3b0afc2f82e54/src/MetadataExtender.ts#L40-L53Then it already works for files. We can then create another issue to make it work for other back-ends if desired.
jvherweg commentedon Mar 9, 2022
The
addPosixMetadatafunction linked above already adds thedcterms:modifiedmetadata, it calls this function on the next line: https://github.com/solid/community-server/blob/982d57e1d2812925b09353445a318d067a242943/src/util/ResourceUtil.ts#L26-L36The iana type could be deduced based on the content type somewhere.
That is only for the
FileDataAccessorthough. If those are mandatory, we either should define in theDataAccessorinterface that those values need to be returned, or that behaviour should be pulled to a higher level. One problem there is thatstat:sizedoesn't really make sense in the memory/sparql data accessor. Do we just return a random number there? We will also have to store the modified date in the memory/sparql data accessor then.Note that currently
DataAccessorsare fully responsible for the metadata returned when you request all container children, through thegetChildrenfunction.The iana type I see multiple potential issues with, and we will have to make sure we have a consistent design here. Which type exactly is returned here? Is it the type that the resource was originally stored with, or is it the type deduced through content negotiation? The first is possible for the file and memory data accessor, but in the case of the sparql data accessor this is completely lost. So there we would return
internal/quadsas types which would result in an invalid iana type. On the other hand, deducing the type based on the accept header to the container request also doesn't make sense in case the container contains resources of differing non-RDF types.jvherweg commentedon Mar 9, 2022
I do admit that I did miss this line, in case we just want a hotfix to make it only work for files we should probably rename the issue and move the other discussion elsewhere.
[-]Expose all required fields in container listings[/-][+]Expose all required fields in container listings for the filesystem backend[/+]RubenVerborgh commentedon Mar 9, 2022
Renamed. Note there there currently is a "hotfix" for files; it just does not return all metadata.
I think we can just fix it for files, and then have a more generic discussion about the accessor architecture. There are several bits that we can reuse more flexibly.
Yeah that mechanism is limited; needs to be resolved on the spec level. It's 0.9, but I expect better solutions for 1.0. (One possibility being https://github.com/RubenVerborgh/solid-metadata-extender/blob/e1e0fccb4c089105778d8a62e5e3b0afc2f82e54/src/MetadataExtender.ts#L58)
jvherweg commentedon Mar 9, 2022
Just as a historical explanation: it's not that there really was a hotfix, it's more that it was never really well defined what metadata should be returned when GETting a container, so every
DataAccessorwas fully free to choose there. TheFileDataAccessorjust happened to make the choice that was the closest to what is needed now 😄.I agree that we can make the file backend more correct for now, as it will only require 1 extra line just to add the iana type, but after that we will need to have that discussion indeed.
bourgeoa commentedon Mar 9, 2022
I think this is related but I may be wrong. If not I shall create an other issue
When using the latest community-server-recipes with mashlib (from main) for each
resourcefile, aresourcefile.metais created containing a triple describing resourcefile length.Removing this
resourcefile.metaapparently do no harm.jvherweg commentedon Mar 9, 2022
@RubenVerborgh that's a consequence of the metadata-extender not marking the added metadata as we do here https://github.com/solid/community-server/blob/982d57e1d2812925b09353445a318d067a242943/src/storage/accessors/FileDataAccessor.ts#L319
So in case of a PATCH that metadata will not be removed before writing back to disk.
RubenVerborgh commentedon Mar 9, 2022
Ah great!
Could that BTW not solve https://github.com/solid/community-server/blob/982d57e1d2812925b09353445a318d067a242943/src/storage/accessors/FileDataAccessor.ts#L196-L201?
jvherweg commentedon Mar 9, 2022
ResponseMetadatais specifically used for metadata that was generated as part of a response, and should not be stored in a resource. The ones above are generated on a higher level and should be stored. It's just that the file data accessor stores them by how the file system works, but the other data accessors store those as actual metadata.Potentially that we need to rethink some things there after the metadata PR is finished.
jvherweg commentedon Mar 28, 2022
Added in #1237. Will be part of v4.0.0