Skip to content

add shapetree.js support to CSS #639

Open

Description

@ericprud

shapetrees.js will probably need extension to address #231 in a user-friendly way.

@joachimvh, are you using solid-test-harness to test CSS?
Please ping me in gitter to confer on how to attack this and where to inject code into CSS.

Activity

  1. jvherweg commented on Mar 1, 2021

    @jvherweg
    Member

    The test harness is not integrated into the repository currently but it is planned to be used.

    I will preface this by saying that I don't know al the details about shapetrees and only have a high-level view of it, so I might make some wrong assumptions based on that.

    There are several components that will probably be relevant for implementing here which I'll explain below so they can be referred back to.

    Auxiliary file support

    Shape files will need to be supported as auxiliary files by the Solid server, so they will need to be configured as such. Currently we already do this for acl files, so it can probably just be done similarly. The configuration of how acl files are configured can be found here. Additionally, they are added to the list of auxiliary types here.

    The main parts that might need new classes are the validator and metadata generator in the config above. Currently the validator is a simple one that only checks if the data being written to a file (acl, or in this case then shape) is valid RDF. In case a more strict validator is needed already, a new class will have to be written for that and then linked there.

    Similarly for the metadata generator. Currently for every resource, a link is made to the corresponding acl URI for that resource is added as metadata, which will then be converted to an acl link type header by this config. If the behaviour for shape files is similar it can be added in the same way, if not we can go deeper into this later.

    All of the above will make sure that shape files are handled as auxiliary files as described in the solid spec.

    Shape support

    Now, to actually support shape functionality it seems best to me to create a new ResourceStore that does this. In CSS, when a request has passed all parsers and has been authorized, it will be sent to an OperationHandler which will then call the corresponding function on the ResourceStore. In practice our ResourceStore is a stack of stores linking to eachother. First the locking store will create a lock on the resource, the conversion store will convert data if needed, etc. Each of these stores then calls the next one in the chain (with DataAccessorBasedStore at the end handling actual data). So for shapes we could just insert a store in that stack somewhere that validates the incoming data against a shape, and then sends the request to the next store. I'm guessing the POST/PUT functions are going to be very similar there. PATCH might be more complicated as we have a separate patching store which calls its handlers to run the patch by getting the data from the backend store, converting it, and sending it back. So perhaps a new handler might be needed there for shapes, or some other adaptation, but I think we can look into that once POST/PUT are supported.

    Feel free to either ask for more details here, or on gitter if you prefer, when needed.

  2. jvherweg commented on Apr 14, 2021

    @jvherweg
    Member

    So after the discussion we had today part of what I said above can be ignored. As discussed I created a new branch with the basics already in there of what is needed. I already added a pseudo implementation of how I understood it to work. There are comments documenting everything so hopefully it is mostly clear by looking at all the changes in 51a8b41.

    The server can start up and will load all the necessary classes but I didn't actually test what happens when PUT/POSTing now so thing will probably break there.

    As mentioned in a TODO comment, besides the new classes being added there, the LinkTypeParser class should be modified into a LinkRelParser class that takes a map as input, mapping rel values to URIs for the metadata, very similar to how LinkRelMetadataWriter does it.

    /cc @ericprud

  3. ericprud commented on Apr 15, 2021

    @ericprud
    Author

    Excellent, this saved me weeks!

  4. woutermont commented on Oct 19, 2021

    @woutermont
    Contributor

    W.r.t. #942, any update on your progress, @ericprud? Thanks!

  5. ericprud commented on Oct 19, 2021

    @ericprud
    Author

    We ended up redoing the spec and concurrently the java impl. @justinwb and I are just finishing cleaning that up. My goal is to limit to small integers the number of times I port it all to typescript. After this next (and hopefully last) port, we'll restart the addition to CSS.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions