patch
Classes:
-
PatchSerializer–Creates an RDF patch file to add and remove triples/quads.
Attributes:
PatchSerializer
PatchSerializer(store: Dataset)
Bases: Serializer
Creates an RDF patch file to add and remove triples/quads. Can either: - Create an add or delete patch for a single Dataset. - Create a patch to represent the difference between two Datasets.
Methods:
-
serialize–Serialize the store to the given stream.
Attributes:
Source code in rdflib/plugins/serializers/patch.py
serialize
serialize(stream: IO[bytes], base: str | None = None, encoding: str | None = None, **kwargs: Any) -> None
Serialize the store to the given stream.
Parameters:
-
(streamIO[bytes]) –The stream to serialize to.
-
(basestr | None, default:None) –The base URI to use for the serialization.
-
(encodingstr | None, default:None) –The encoding to use for the serialization.
-
(kwargsAny, default:{}) –Additional keyword arguments.
Supported keyword arguments:
- operation: The operation to perform. Either ‘add’ or ‘remove’.
- target: The target Dataset to compare against. NB: Only one of ‘operation’ or ‘target’ should be provided.
- header_id: The header ID to use.
- header_prev: The previous header ID to use.