Struggling with paralell uploads and queries to Virtuoso

Not quite as you are characterizing it. We are saying that your approach isn’t best approach when dealing with a DBMS that supports ACID.

A Named Graph isn’t an object in Virtuoso, it is a collection of sets of records grouped by predicates as reflected in the GSPO index on the RDF_QUAD system table.

The code provided to you demonstrates how to achieve your goals within the traditional transactional constraints of ACID. It also includes an optimization for working large datasets using RDF4j.

Alright, thank you for clarifying. The changes required for the uploads to be “within the traditional transactional constraints of ACID” unfortunately isn’t an option for us. The “commit after clear” would provide to long of a window during the upload of the dataset where data can’t be queried in the database. We’ll have to think of another way to increase performance.

Your current approach is seeking to perform a mix of delete and insert operations on lots of relations where concurrency is ultimately informed by the transactional semantics of ACID.

Our sample application code is offering you solutions for optimizing for this reality. Please confirm you’ve digested the most recent examples published to our github repo re RDF4j usage.

The fork @smalinin did is already merged. We’ll take another look at Virtuoso_Java_Samples aswell. Thank you @hwilliams @smalinin @kidehen for take putting your time and effort looking into this!