Avoid changing Repository while tx is in progress
Avoid changing Repository while tx is in progress

Adding or deleting statements in the Repository causes serializable
transactions to break (correctly). Instead, prepare the repository state
before beginning the test transaction.

ruby-rdf/rdf-spec