Model operations performance improvements (#347)

* created RDFServiceBulkUnionUpdater

* fix and indents

* use bulk updater for RDFServiceGraph in blankNodeFilteringGraph

* use removeAll to optimize removal all triples from TDB modeles

* avoid additional serialization/deserialization cycle of removing model chunk

* fixed VitroModelFactory tests

* fixes for BulkUpdating models

* Created custom ModelCom, OntModelImpl, BulkGraphMem to avoid triple by triple transactions on add/remove model
Load n3 files from home directory into in-memory model to use bulk
loading.

* refact: simplified BulkGraphMem checks

* removed unused import
This commit is contained in:
Georgy Litvinov 2022-11-25 18:47:21 +01:00 committed by GitHub
parent 2e682e6f38
commit 020b9385f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 434 additions and 128 deletions

View file

@ -346,10 +346,13 @@ public class VitroModelFactoryTest extends AbstractTestClass {
public void addMultipleToVitroUnion() {
umg = new VitroUnionModelGroup();
umg.m.add(MULTIPLE_STATEMENTS);
new MethodCalls().add(umg.base.g, "add", "add")
.add(umg.base.l, "addedStatement", "addedStatement")
.add(umg.plus.g).add(umg.plus.l)
.add(umg.l, "addedStatements").test();
new MethodCalls()
.add(umg.base.g, "performAdd", "performAdd")
.add(umg.base.l, "addedStatements", "addedStatements")
.add(umg.plus.g)
.add(umg.plus.l)
.add(umg.l)
.test();
}
// ----------------------------------------------------------------------
@ -452,10 +455,12 @@ public class VitroModelFactoryTest extends AbstractTestClass {
public void addMultipleToVitroOntUnion() {
uomg = new VitroUnionOntModelGroup();
uomg.om.add(MULTIPLE_STATEMENTS);
new MethodCalls().add(uomg.base.g, "add", "add")
new MethodCalls()
.add(uomg.base.g, "add", "add")
.add(uomg.base.l, "addedStatement", "addedStatement")
.add(uomg.plus.g).add(uomg.plus.l)
.add(uomg.l, "addedStatements").test();
.add(uomg.l)
.test();
}
// ----------------------------------------------------------------------
@ -566,12 +571,16 @@ public class VitroModelFactoryTest extends AbstractTestClass {
public void addMultipleToVitroOntModeledUnionModel() {
omumg = new VitroOntModelUnionModelGroup();
omumg.om.add(MULTIPLE_STATEMENTS);
new MethodCalls().add(omumg.om, "add").add(omumg.ol, "addedStatements")
.add(omumg.union.base.g, "add", "add")
.add(omumg.union.base.m)
.add(omumg.union.base.l, "addedStatement", "addedStatement")
new MethodCalls()
.add(omumg.om, "add")
.add(omumg.ol)
.add(omumg.union.base.g, "performAdd", "performAdd")
.add(omumg.union.base.m, "add", "add")
.add(omumg.union.base.l, "addedStatements", "addedStatements")
.add(omumg.union.plus.g)
.add(omumg.union.plus.m).add(omumg.union.plus.l).test();
.add(omumg.union.plus.m)
.add(omumg.union.plus.l)
.test();
}
// ----------------------------------------------------------------------