-
Notifications
You must be signed in to change notification settings - Fork 571
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
Implement RDF Patch serializer #2877
Implement RDF Patch serializer #2877
Conversation
…nstances only; triples and quads within a Dataset are supported.
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.
As discussed in our chat, this version of the serializer could function as a utility function rather than a serializer, performing one of two operations:
-
Add or Remove Operation: Takes a dataset with an
add
orremove
operation parameter and generates an RDF patch. -
Difference Operation: Takes two datasets and performs a
difference
operation, with the second dataset as the "target".
This approach allows us to reserve the patch serializer for RDF patches on an RDFLib store with change tracking enabled. The backend would track changes applied to the store through a series of RDF patches, and the serializer would output these patches sequentially.
I'm not suggesting we need to implement this, but just toying with what the potential RDFLib public interfaces may look like with a complete RDF patch support.
The mypy issues in |
@recalcitrantsupplant
|
@recalcitrantsupplant I thought this was complete and passing tests and ready to merge, however after merging it there are now some test failures appearing in As @edmondchuc mentioned above, I don't know what use this is as a regular RDFLib serializer, because you really need to associate it with actions such as To allow |
@recalcitrantsupplant Another update, I haven't revered this yet. This prevents unexpectedly getting a |
The issue described in the previous two comments is now fixed by #2898 so tests in |
Supports serialization from Dataset instances only; triples and quads within a Dataset are supported.
Summary of changes
Three methods to create RDF Patches from RDFLib Datasets:
Basic usage:
ds.serialize(format="patch", operation="add")
ds.serialize(format="patch", operation="remove")
ds1.serialize(format="patch", target=ds2)
Complete examples are provided in an example script.
Checklist
the same change.
Created an issue to discuss the change and get in-principle agreement.Discussed w/ maintainers./examples
.so maintainers can fix minor issues and keep your PR up to date.