Skip to content

Commit

Permalink
[skip ci] wip 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Feb 16, 2024
1 parent 98c9eef commit 9eea579
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,28 @@ private boolean tripleExistInHDT(TripleID tripleID) {
}

private void assignBitMapDeletes(TripleID tripleID, Resource subj, IRI pred, Value obj) throws SailException {
if (tripleID.isEmpty()) {
// clear
for (TripleComponentOrder order : endpoint.getValidOrders()) {
IteratorTripleID iter = endpoint.getHdt().getTriples().search(tripleID, order.mask);

while (iter.hasNext()) {
iter.next();
long index = iter.getLastTriplePosition();

assert iter.isLastTriplePositionBoundToOrder();
TripleComponentOrder sorder = iter.getOrder();

if (!this.endpoint.getDeleteBitMap(sorder).access(index)) {
this.endpoint.getDeleteBitMap(sorder).set(index, true);
if (this.endpoint.isMerging()) {
this.endpoint.getTempDeleteBitMap(sorder).set(index, true);
}
}
}
}
return;
}

if (tripleID.getSubject() != -1 && tripleID.getPredicate() != -1 && tripleID.getObject() != -1) {
for (TripleComponentOrder order : endpoint.getValidOrders()) {
Expand All @@ -534,7 +556,7 @@ private void assignBitMapDeletes(TripleID tripleID, Resource subj, IRI pred, Val
if (this.endpoint.isMerging()) {
this.endpoint.getTempDeleteBitMap(sorder).set(index, true);
}
if (order == TripleComponentOrder.SPO && subj != null && pred != null && obj != null) {
if (order == TripleComponentOrder.SPO) {
notifyStatementRemoved(this.endpoint.getValueFactory().createStatement(subj, pred, obj));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@
import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.SailException;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.io.TempDir;
import org.junit.rules.TemporaryFolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -125,6 +121,9 @@ public HDT loadIndex() throws IOException {
}
};
// endpoint.setThreshold(2);
if (EndpointSPARQL11QueryComplianceTest.PRINT) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(endpoint)));
}
return new SailRepository(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public HDT loadIndex() throws IOException {
};
// endpoint.setThreshold(2);

if (EndpointSPARQL11QueryComplianceTest.PRINT) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(endpoint)));
}
return new SailRepository(endpoint);
// return new DatasetRepository(new SailRepository(new
// NativeStore(tempDir.newFolder(), "spoc")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @author Ali Haidar
*/
public class EndpointSPARQL11QueryComplianceTest extends SPARQL11QueryComplianceTest {
public static boolean PRINT = true;
private static final Logger logger = LoggerFactory.getLogger(EndpointSPARQL11QueryComplianceTest.class);

public EndpointSPARQL11QueryComplianceTest() {
Expand Down Expand Up @@ -95,7 +96,10 @@ protected Repository newRepository() throws Exception {
endpoint = new EndpointStore(hdtStore.toAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME, spec,
nativeStore.toAbsolutePath() + "/", true);
// endpoint.setThreshold(2);
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(endpoint)));
if (EndpointSPARQL11QueryComplianceTest.PRINT) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(endpoint)));
}
return new SailRepository(endpoint);
}

HDT hdt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ protected Repository newRepository() throws Exception {
spec, nativeStore.toAbsolutePath() + "/", true);
// endpoint.setThreshold(2);

if (EndpointSPARQL11QueryComplianceTest.PRINT) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(endpoint)));
}
return new SailRepository(endpoint);
// return new DatasetRepository(new SailRepository(new
// NativeStore(tempDir.newFolder(), "spoc")));
Expand Down

0 comments on commit 9eea579

Please sign in to comment.