-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Edit metadata resources #1188
Feat: Edit metadata resources #1188
Conversation
…w metadata files to be edited when a resource is available
…h PUT to container
… operationhandlers
…ible to edit (read reset) metadata
d7cf765
to
a8063e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some high level changes are still going to be needed to make this a generic solution.
…eck to new patchhandler which is more generic
…handler down to DABS
… to DataAccessors (part 1)
…riteMetadata in DataAccessor.ts (now taking subject identifier instead of metadata resource identifier)
…efault in the (converting.json)
# Conflicts: # RELEASE_NOTES.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most comments are minor refactors. Only one that might still be an issue is the container generation issue.
Did not look at the tests because at this point it's hard to know where still to look there 😅. Let me know if there are tests of specific classes you want me to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor comments remaining as you can see. Can fix them myself if you prefer at this point.
/** | ||
* The data of this representation which conforms to the RDF/JS Dataset interface | ||
* (https://rdf.js.org/dataset-spec/#dataset-interface). | ||
*/ | ||
dataset: Store; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataset: Store; | |
dataset: Dataset; |
How much of a hassle would it be to use this type? Can be imported from rdf-js
.
If the answer is that we would need multiple casts in several places then Store
can stay, but if it changes (almost) nothing it would be better to use the correct interface here.
); | ||
const immutablePatternMap = new Map<FilterPattern, Quad[]>(); | ||
const baseSubject = namedNode(this.metadataStrategy.getSubjectIdentifier(input.identifier).path); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('does not log warnings when container resource creation fails.', async(): Promise<void> => { | ||
store.setRepresentation.mockRejectedValueOnce(new ConflictHttpError('bad input')); | ||
generatorData = [ | ||
{ identifier: { path: 'http://test.com/foo/' }, representation: '/container/' as any }, | ||
]; | ||
await expect(initializer.handle()).resolves.toBeUndefined(); | ||
expect(generator.generate).toHaveBeenCalledTimes(1); | ||
expect(store.setRepresentation).toHaveBeenCalledTimes(1); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test still succeeds even though the specific code for this was removed 😄. This test should have checked if the logger emitted a warning, but since that piece of code is gone again it can just be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
📁 Related issues
Closes #1027
✍️ Description
This PR implements the design choices from issue #1027.
Behaviour changes of a GET request:
Behaviour changes of a POST request (PostOperationHandler):
Behaviour changes of a PUT request (PutOperationHandler):
Behaviour changes of a PATCH request (PatchOperationHandler && RepresentationPatchHandler)
Behaviour changes of a DELETE request (DeleteOperationHandler):
✅ PR check list
Before this pull request can be merged, a core maintainer will check whether