Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ate47 committed Feb 15, 2024
1 parent a697f7b commit 8659657
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public EndpointTripleSource(EndpointStoreConnection endpointStoreConnection, End
this.endpoint = endpoint;
this.numberOfCurrentTriples = endpoint.getHdt().getTriples().getNumberOfElements();
this.endpointStoreConnection = endpointStoreConnection;
this.enableMergeJoin = endpoint.getHDTSpec().getBoolean("qendpoint.mergejoin", true);
this.enableMergeJoin = endpoint.getHDTSpec().getBoolean("qendpoint.mergejoin", false);
}

private void initHDTIndex() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.core.triples.impl.BitmapTriplesIndexFile;
import com.the_qa_company.qendpoint.utils.FileUtils;
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 @@ -62,12 +65,10 @@ public EndpointMultIndexSPARQL11QueryComplianceTest() {
this.setIgnoredTests(testToIgnore);
}

@Rule
public TemporaryFolder tempDir = TemporaryFolder.builder().assureDeletion().build();
@TempDir
public Path tempDir;

EndpointStore endpoint;
File nativeStore;
File hdtStore;

@Override
protected void testParameterListener(String displayName, String testURI, String name, String queryFileURL,
Expand All @@ -81,22 +82,26 @@ protected void testParameterListener(String displayName, String testURI, String

@Override
protected Repository newRepository() throws Exception {
nativeStore = tempDir.newFolder();
hdtStore = tempDir.newFolder();
FileUtils.deleteRecursively(tempDir);
Path nativeStore = tempDir.resolve("ns");
Path hdtStore = tempDir.resolve("hdt");

Files.createDirectories(nativeStore);
Files.createDirectories(hdtStore);

HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS, HDTOptionsKeys.BITMAPTRIPLES_INDEX_OTHERS,
EnumSet.of(TripleComponentOrder.SPO, TripleComponentOrder.OPS, TripleComponentOrder.PSO));
Path fileName = Path.of(hdtStore.getAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME);
Path fileName = Path.of(hdtStore.toAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME);
if (this.hdt == null) {
hdt = Utility.createTempHdtIndex(tempDir, true, false, spec);
hdt = Utility.createTempHdtIndex(tempDir.resolve("test.nt").toAbsolutePath().toString(), true, false, spec);
}
assert hdt != null;

hdt.saveToHDT(fileName, null);

endpoint = new EndpointStore(hdtStore.getAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME, spec,
nativeStore.getAbsolutePath() + "/", true) {
endpoint = new EndpointStore(hdtStore.toAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME, spec,
nativeStore.toAbsolutePath() + "/", true) {
@Override
public HDT loadIndex() throws IOException {
HDT idx = super.loadIndex();
Expand All @@ -105,9 +110,9 @@ public HDT loadIndex() throws IOException {
}
try {
Path fileOPS = BitmapTriplesIndexFile.getIndexPath(fileName, TripleComponentOrder.OPS);
Assert.assertTrue("can't find " + fileOPS, Files.exists(fileOPS));
Assertions.assertTrue(Files.exists(fileOPS), "can't find " + fileOPS);
Path filePSO = BitmapTriplesIndexFile.getIndexPath(fileName, TripleComponentOrder.PSO);
Assert.assertTrue("can't find " + filePSO, Files.exists(filePSO));
Assertions.assertTrue(Files.exists(filePSO), "can't find " + filePSO);
} catch (Throwable t) {
try (Stream<Path> l = Files.list(fileName.getParent())) {
l.forEach(System.err::println);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@
import com.the_qa_company.qendpoint.core.hdt.HDT;
import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.core.triples.impl.BitmapTriplesIndex;
import com.the_qa_company.qendpoint.core.triples.impl.BitmapTriplesIndexFile;
import org.eclipse.rdf4j.model.IRI;
import com.the_qa_company.qendpoint.utils.FileUtils;
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.SPARQL11UpdateComplianceTest;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.io.TempDir;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

public class EndpointMultIndexSPARQL11UpdateComplianceTest extends SPARQL11UpdateComplianceTest {
Expand All @@ -42,26 +37,29 @@ public EndpointMultIndexSPARQL11UpdateComplianceTest() {
this.setIgnoredTests(testToIgnore);
}

@Rule
public TemporaryFolder tempDir = TemporaryFolder.builder().assureDeletion().build();
@TempDir
public Path tempDir;

@Override
protected Repository newRepository() throws Exception {
File nativeStore = tempDir.newFolder();
File hdtStore = tempDir.newFolder();
FileUtils.deleteRecursively(tempDir);
Path nativeStore = tempDir.resolve("ns");
Path hdtStore = tempDir.resolve("hdt");

Files.createDirectories(nativeStore);
Files.createDirectories(hdtStore);

HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS, HDTOptionsKeys.BITMAPTRIPLES_INDEX_OTHERS,
EnumSet.of(TripleComponentOrder.SPO, TripleComponentOrder.OPS, TripleComponentOrder.PSO));
Path fileName = Path.of(hdtStore.getAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME);
long size;
try (HDT hdt = Utility.createTempHdtIndex(tempDir, true, false, spec)) {
Path fileName = Path.of(hdtStore.toAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME);
try (HDT hdt = Utility.createTempHdtIndex(tempDir.resolve("test.nt").toAbsolutePath().toString(), true, false, spec)) {
assert hdt != null;
size = hdt.getTriples().getNumberOfElements();
hdt.saveToHDT(fileName, null);
}

EndpointStore endpoint = new EndpointStore(hdtStore.getAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME,
spec, nativeStore.getAbsolutePath() + "/", true) {
EndpointStore endpoint = new EndpointStore(hdtStore.toAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME,
spec, nativeStore.toAbsolutePath() + "/", true) {

@Override
public HDT loadIndex() throws IOException {
Expand All @@ -71,9 +69,9 @@ public HDT loadIndex() throws IOException {
}
try {
Path fileOPS = BitmapTriplesIndexFile.getIndexPath(fileName, TripleComponentOrder.OPS);
Assert.assertTrue("can't find " + fileOPS, Files.exists(fileOPS));
Assertions.assertTrue(Files.exists(fileOPS), "can't find " + fileOPS);
Path filePSO = BitmapTriplesIndexFile.getIndexPath(fileName, TripleComponentOrder.PSO);
Assert.assertTrue("can't find " + filePSO, Files.exists(filePSO));
Assertions.assertTrue(Files.exists(filePSO), "can't find " + filePSO);
} catch (Throwable t) {
try (Stream<Path> l = Files.list(fileName.getParent())) {
l.forEach(System.err::println);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

package com.the_qa_company.qendpoint.store;

import com.the_qa_company.qendpoint.utils.FileUtils;
import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.io.TempDir;
import com.the_qa_company.qendpoint.core.enums.RDFNotation;
import com.the_qa_company.qendpoint.core.exceptions.NotFoundException;
import com.the_qa_company.qendpoint.core.exceptions.ParserException;
Expand All @@ -21,6 +21,8 @@
import java.io.IOException;
import java.net.JarURLConnection;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand All @@ -44,14 +46,16 @@ public EndpointSPARQL11QueryComplianceTest() {
// named graphs anyway
"constructwhere02 - CONSTRUCT WHERE", "constructwhere03 - CONSTRUCT WHERE",
"constructwhere04 - CONSTRUCT WHERE", "Exists within graph pattern", "(pp07) Path with one graph",
"(pp06) Path with two graphs", "(pp34) Named Graph 1",
"(pp35) Named Graph 2", "sq01 - Subquery within graph pattern",
"sq02 - Subquery within graph pattern, graph variable is bound",
"sq03 - Subquery within graph pattern, graph variable is not bound",
"sq04 - Subquery within graph pattern, default graph does not apply",
"sq05 - Subquery within graph pattern, from named applies",
"sq06 - Subquery with graph pattern, from named applies", "sq07 - Subquery with from ",
"sq11 - Subquery limit per resource", "sq13 - Subqueries don't inject bindings",
"sq14 - limit by resource");
"sq14 - limit by resource",
"");

this.setIgnoredTests(testToIgnore);
}
Expand All @@ -66,29 +70,31 @@ protected void testParameterListener(String displayName, String testURI, String
}
}

@Rule
public TemporaryFolder tempDir = TemporaryFolder.builder().assureDeletion().build();
@TempDir
public Path tempDir;

EndpointStore endpoint;
File nativeStore;
File hdtStore;

@Override
protected Repository newRepository() throws Exception {
nativeStore = tempDir.newFolder();
hdtStore = tempDir.newFolder();
FileUtils.deleteRecursively(tempDir);
Path nativeStore = tempDir.resolve("ns");
Path hdtStore = tempDir.resolve("hdt");

Files.createDirectories(nativeStore);
Files.createDirectories(hdtStore);

HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS);
if (this.hdt == null) {
hdt = Utility.createTempHdtIndex(tempDir, true, false, spec);
hdt = Utility.createTempHdtIndex(tempDir.resolve("temp.nt").toAbsolutePath().toString(), true, false, spec);
}
assert hdt != null;

hdt.saveToHDT(hdtStore.getAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME, null);
hdt.saveToHDT(hdtStore.toAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME, null);

endpoint = new EndpointStore(hdtStore.getAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME, spec,
nativeStore.getAbsolutePath() + "/", true);
endpoint = new EndpointStore(hdtStore.toAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME, spec,
nativeStore.toAbsolutePath() + "/", true);
// endpoint.setThreshold(2);
return new SailRepository(endpoint);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
package com.the_qa_company.qendpoint.store;

import com.the_qa_company.qendpoint.core.hdt.HDT;
import com.the_qa_company.qendpoint.core.hdt.HDTManager;
import com.the_qa_company.qendpoint.core.iterator.utils.EmptyIterator;
import com.the_qa_company.qendpoint.core.listener.ProgressListener;
import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.utils.FileUtils;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11UpdateComplianceTest;
import org.junit.Rule;
import org.junit.jupiter.api.io.TempDir;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -37,22 +44,27 @@ public EndpointSPARQL11UpdateComplianceTest() {
this.setIgnoredTests(testToIgnore);
}

@Rule
public TemporaryFolder tempDir = TemporaryFolder.builder().assureDeletion().build();
@TempDir
public Path tempDir;

@Override
protected Repository newRepository() throws Exception {
File nativeStore = tempDir.newFolder();
File hdtStore = tempDir.newFolder();
FileUtils.deleteRecursively(tempDir);
Path nativeStore = tempDir.resolve("ns");
Path hdtStore = tempDir.resolve("hdt");

Files.createDirectories(nativeStore);
Files.createDirectories(hdtStore);

HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS);
try (HDT hdt = Utility.createTempHdtIndex(tempDir, true, false, spec)) {
try (HDT hdt = HDTManager.generateHDT(EmptyIterator.of(), Utility.EXAMPLE_NAMESPACE, HDTOptions.of(), ProgressListener.ignore())) {
assert hdt != null;
hdt.saveToHDT(hdtStore.getAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME, null);
hdt.saveToHDT(hdtStore.toAbsolutePath() + "/" + EndpointStoreTest.HDT_INDEX_NAME, null);
}

EndpointStore endpoint = new EndpointStore(hdtStore.getAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME,
spec, nativeStore.getAbsolutePath() + "/", true);
EndpointStore endpoint = new EndpointStore(hdtStore.toAbsolutePath() + "/", EndpointStoreTest.HDT_INDEX_NAME,
spec, nativeStore.toAbsolutePath() + "/", true);
// endpoint.setThreshold(2);

return new SailRepository(endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.store.Utility;
import com.the_qa_company.qendpoint.utils.FileUtils;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.NotifyingSailConnection;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.jupiter.api.io.TempDir;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -47,6 +49,8 @@ public ExperimentalQEndpointSPARQL11ComplianceQueryTest() {
protected Repository newRepository() throws Exception {
HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS_LANG);
FileUtils.deleteRecursively(tempDir);
Files.createDirectories(tempDir);
ExperimentalQEndpointSail sail = new ExperimentalQEndpointSail(tempDir, spec);

if (PRINT_CALLS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.store.Utility;
import com.the_qa_company.qendpoint.utils.FileUtils;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.NotifyingSailConnection;
Expand Down Expand Up @@ -43,6 +44,8 @@ public ExperimentalQEndpointSPARQL11ComplianceUpdateTest() {

@Override
protected Repository newRepository() throws Exception {
FileUtils.deleteRecursively(tempDir);
Files.createDirectories(tempDir);
HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS_LANG);
ExperimentalQEndpointSail sail = new ExperimentalQEndpointSail(tempDir, spec);
Expand Down

0 comments on commit 8659657

Please sign in to comment.