Stores all data and metadata of resources in a SPARQL backend. Communication is done by sending SPARQL queries. Queries are constructed in such a way to keep everything consistent, such as updating containment triples and deleting old data when it is overwritten.
Since metadata is hidden, no containment triples are stored for metadata files.
All input container metadata is stored in its metadata identifier. The containment triples are stored in the graph corresponding to the actual identifier so those don't get overwritten.
Only Quad data streams are supported.
Removes all graph data relevant to the given identifier.
Returns metadata for all resources in the requested container. This should not be all metadata of those resources (but it can be), but instead the main metadata you want to show in situations where all these resources are presented simultaneously. Generally this would be metadata that is present for all of these resources, such as resource type or last modified date.
It can be safely assumed that the incoming identifier will always correspond to a container.
Identifier of the parent container.
Returns all triples stored for the corresponding identifier. Note that this will not throw a 404 if no results were found.
Returns the metadata for the corresponding identifier. Will throw 404 if no metadata was found.
Creates the name for the metadata of a resource.
Name of the (non-metadata) resource.
Helper function to get named nodes corresponding to the identifier and its parent container. In case of a root container only the name will be returned.
Checks if the given identifier corresponds to the names used for metadata identifiers.
Sends a SPARQL CONSTRUCT query to the endpoint and returns a stream of quads.
Query to execute.
Sends a SPARQL update query to the stored endpoint.
Query to send.
Creates a CONSTRUCT query that returns all quads contained within a single resource.
Name of the resource to query.
Creates a query that deletes everything related to the given name.
Name of resource to delete.
Parent of the resource to delete so the containment triple can be removed (unless root).
Creates an update query that overwrites the data and metadata of a resource. If there are no triples we assume it's a container (so don't overwrite the main graph with containment triples).
Name of the resource to update.
New metadata of the resource.
Name of the parent to update the containment triples.
New data of the resource.
Creates an update query that overwrites metadata of a resource.
Name of the metadata resource to update.
New metadata of the resource.
Helper function for creating SPARQL update queries. Creates an operation for deleting all triples in a graph.
Name of the graph to delete.
Helper function for creating SPARQL update queries. Creates a Graph selector with the given triples.
Name of the graph.
Triples/triple patterns to select.
Writes the given metadata for the container.
Reads the given data stream and stores it together with the metadata.
Reads the metadata and stores it.