I work with a simple Jena dataset that has only one ~ 30 MB RDF file. As part of the application, I am trying to allow users to query the default graph (or named graph) and insert the resulting triples from the query into a new named graph. To do this, I use the CONSTRUCT statement to form the resulting set of triples in the RDF form, and then inserting these triples into a new model (using QueryExecution.execConstruct ()) and adding this model to the dataset. This seems to work again as the dataset gets a new node graph, and the disk size in the TDB database database is increasing.
The problem occurs when I try to remove a named graph from a dataset. Using the Dataset method removeNamedName ("graphName"), I remove the model from the dataset. Future queries by the name of this model indicate that it has been successfully deleted. However, the disk size in the TDB database database remains the same size, even after synchronization and shutdown.
At first, I thought that perhaps the database simply marks the deleted file space as free so that it can be overwritten as new data arrives, but that doesn't seem to be the case. If I delete the named graph and replace it immediately after the program starts in the same run, the folder does not seem to grow, but if I add a new named graph and delete it in the same run, the folder will become larger and the delete model does not free memory, which means that after several starts, the database folder is five or ten times larger than its original size, without saving any data.
Any insights or help would be great, thanks again.
source share