middleware.common¶
Small shared helpers for middleware implementations.
Functions¶
|
Return an new copy of a graph in |
|
Return an new copy of a dataset in |
|
Return |
Module Contents¶
- middleware.common.copy_graph(source_graph: rdflib.Graph) rdflib.Graph¶
Return an new copy of a graph in
O(triples)time.The new graph is backed by a
rdflib.plugins.stores.memory.Memorystore. Be aware of the size of yoursource_graphbefore invoking this function. Aside from the store, the returned graph replicates all of the source graph’s properties: namespace bindings, base URI, identifier, and triples.
- middleware.common.copy_dataset(source_dataset: rdflib.Dataset) rdflib.Dataset¶
Return an new copy of a dataset in
O(quads)time.The new dataset is backed by a
rdflib.plugins.stores.memory.Memorystore. Be aware of the size of yoursource_datasetbefore invoking this function. Aside from the store, the returned dataset replicates all of the source dataset’s properties: namespace bindings, default graph base URI, and quads.