Skip to content

Support PATCHing containers - #955

Merged
jvherweg merged 2 commits into
versions/2.0.0from
fix/patch-containers
Sep 16, 2021
Merged

jvherweg merged 2 commits into
versions/2.0.0from
fix/patch-containers

Conversation

@jvherweg

Copy link
Copy Markdown
Member

Closes #917 and #384.

Patching has been changed so we now have a RepresentationPatchHandler that calls the ResourceStore. It then sends the representation it gets from that to a RepresentationPatcher. We now have 2 patchers in a waterfall handler: the first one handles containers by creating a new representation from the metadata that strips all generated metadata, the second one converts the data to quads (this we already had). Both then send the result to the sparql update patcher.

Minor other change:

  • DataAccessor.canHandle is now only called on documents, not all resources. Reason is that the incoming representation is not relevant for containers since everything gets converted to metadata.

@jvherweg jvherweg added the semver.major Requires a major version bump label Sep 13, 2021

@RubenVerborgh RubenVerborgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Minor comment: it seems that several of the ifs in the ConvertingPatcher can be handled with composition of existing converters instead. I'm fine either way, just wanted to make sure that this option was considered.

Comment thread src/storage/DataAccessorBasedStore.ts Resolved
Comment thread src/storage/patch/ContainerPatcher.ts Resolved
Comment thread src/storage/patch/ContainerPatcher.ts Resolved
Comment thread src/storage/patch/ConvertingPatcher.ts Resolved
Comment thread src/storage/patch/ConvertingPatcher.ts Resolved
Comment thread src/storage/patch/ConvertingPatcher.ts Resolved
@jvherweg

Copy link
Copy Markdown
Member Author

Minor comment: it seems that several of the ifs in the ConvertingPatcher can be handled with composition of existing converters instead. I'm fine either way, just wanted to make sure that this option was considered.

You mean having a separate patcher for when the input contains no Representation? One issue is that the behaviour is still slightly different for containers and documents: in the case of documents we still want to convert back to a non-quad type.

I did go through several iterations of handler structure here and never found something that completely covered everything that I wanted, this is simply the closest I got. So I do feel there might still be improvement possible here. At one point I even made a ReduceHandler that passed the output of one patcher to the next, but that made the canHandle situation even more complex.

@RubenVerborgh

Copy link
Copy Markdown
Member

Thanks, all good to go!

Also included is a change to the Patching architecture.
Patching is now done by RepresentationPatchers that take a Representation as input.
@jvherweg
jvherweg force-pushed the fix/patch-containers branch from 283802b to dd2d8a5 Compare September 16, 2021 09:52
@jvherweg
jvherweg merged commit ef9703e into versions/2.0.0 Sep 16, 2021
@jvherweg
jvherweg deleted the fix/patch-containers branch September 16, 2021 11:39
@jvherweg jvherweg added this to the v2.0.0 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver.major Requires a major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants