Skip to content

Commit 222e34b

Browse files
authored
Merge pull request #26 from mjovanovik/develop/2
Merge of the major new version from develop/2
2 parents 2365f89 + 26eca8a commit 222e34b

File tree

623 files changed

+11959
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

623 files changed

+11959
-254
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ dependency-reduced-pom.xml
1111
.classpath
1212
.project
1313
.settings/
14+
.idea/
15+
GeoSPARQLBenchmark.iml
16+
src/main/resources/.DS_Store

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# GeoSPARQL Benchmark
1+
# GeoSPARQL Compliance Benchmark
22

3-
This is the GeoSPARQL Benchmark, integrated into the [HOBBIT Platform](https://github.com/hobbit-project/platform).
3+
This is the GeoSPARQL Compliance Benchmark, integrated into the [HOBBIT Platform](https://github.com/hobbit-project/platform).
44

5-
The GeoSPARQL Benchmark (GSB) aims to evaluate GeoSPARQL compliance of RDF storage systems. The current version of the benchmark is based on the [GeoSPARQL subtest](https://github.com/BorderCloud/TFT-tests/tree/master/geosparql) of [Tester-for-Triplestores](https://github.com/BorderCloud/TFT) and the [SPARQLScore](http://sparqlscore.com/) standard conformance test suite.
5+
The GeoSPARQL Compliance Benchmark aims to evaluate the GeoSPARQL compliance of RDF storage systems. The benchmark uses
6+
206 SPARQL queries to test the extent to which the benchmarked system supports the 30 requirements defined in the [GeoSPARQL standard](https://www.ogc.org/standards/geosparql).
7+
8+
As a result, the benchmark provides two metrics:
9+
* **Correct answers**: The number of correct answers out of all GeoSPARQL queries, i.e. tests.
10+
* **GeoSPARQL compliance percentage**: The percentage of compliance with the requirements of the GeoSPARQL standard.
11+
12+
You can find a set of results from the [latest experiments on the hosted instance of the HOBBIT Platform](https://master.project-hobbit.eu/experiments/1612476122572,1612477003063,1612476116049,1612477500164,1612477015896,1612477025778,1612477047489,1612477849872,1612478626265,1612479271411)
13+
(log in as Guest).
14+
15+
If you want your RDF triplestore tested, you can [add it as a system to the HOBBIT Platform](https://hobbit-project.github.io/system_integration.html),
16+
and then [run an experiment](https://hobbit-project.github.io/benchmarking.html) using the [hosted instance of the HOBBIT Platform](https://hobbit-project.github.io/master.html).

hobbit-settings/benchmark.ttl

Lines changed: 1228 additions & 29 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@
2929
</properties>
3030

3131
<dependencies>
32+
<!-- https://mvnrepository.com/artifact/org.apache.xml.security/xml-security -->
33+
<!-- https://mvnrepository.com/artifact/org.apache.santuario/xmlsec -->
34+
<dependency>
35+
<groupId>org.apache.santuario</groupId>
36+
<artifactId>xmlsec</artifactId>
37+
<version>2.2.1</version>
38+
</dependency>
39+
40+
41+
<dependency>
42+
<groupId>com.fasterxml.jackson.core</groupId>
43+
<artifactId>jackson-databind</artifactId>
44+
<version>2.11.1</version>
45+
</dependency>
46+
<!-- https://mvnrepository.com/artifact/org.json/json -->
47+
<dependency>
48+
<groupId>org.json</groupId>
49+
<artifactId>json</artifactId>
50+
<version>20201115</version>
51+
</dependency>
3252
<dependency>
3353
<groupId>org.hobbit</groupId>
3454
<artifactId>core</artifactId>

src/main/.DS_Store

6 KB
Binary file not shown.

src/main/java/org/hobbit/geosparql/GSBBenchmarkController.java

Lines changed: 206 additions & 3 deletions
Large diffs are not rendered by default.

src/main/java/org/hobbit/geosparql/GSBDataGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public void close() throws IOException {
5757
}
5858

5959
private void getFileAndSendData() {
60-
String datasetFile = "gsb_dataset/example.rdf";
61-
String datasetURI = "http://bordercloud.github.io/TFT-tests/geosparql/illustration/example.rdf";
60+
String datasetFile = "gsb_dataset/dataset.rdf";
61+
String datasetURI = "http://openlinksw.com/geosparql/dataset.rdf";
6262

6363
try {
6464
LOGGER.info("Getting file " + datasetFile);
@@ -91,7 +91,7 @@ public void receiveCommand(byte command, byte[] data) {
9191
for (int i=0; i < GSBConstants.GSB_QUERIES.length; i++) {
9292
InputStream inputStream = new FileInputStream("gsb_queries/" + GSBConstants.GSB_QUERIES[i]);
9393
String fileContent = IOUtils.toString(inputStream);
94-
fileContent = "#Q0" + (i+1) + "\n" + fileContent; // add a comment line at the beginning of the query, to denote the query number (Q01, Q02, ...)
94+
fileContent = "#Q-" + (i+1) + "\n" + fileContent; // add a comment line at the beginning of the query, to denote the query number (#Q-1, #Q-2, ...)
9595
byte[] bytesArray = null;
9696
bytesArray = RabbitMQUtils.writeString(fileContent);
9797
sendDataToTaskGenerator(bytesArray);

src/main/java/org/hobbit/geosparql/GSBEvaluationModule.java

Lines changed: 1548 additions & 31 deletions
Large diffs are not rendered by default.

src/main/java/org/hobbit/geosparql/GSBSeqTaskGenerator.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.hobbit.geosparql;
22

33
import java.io.ByteArrayOutputStream;
4+
import java.io.File;
45
import java.io.FileInputStream;
56
import java.io.IOException;
67
import java.io.InputStream;
@@ -50,6 +51,21 @@ private void internalInit() {
5051
ResultSetFormatter.outputAsJSON(outputStream, rsf.fromXML(inputStream));
5152
answers[i] = outputStream.toString();
5253
inputStream.close();
54+
for (int k=1; ; k++) {
55+
String alternativeAnswerFileName = GSBConstants.GSB_ANSWERS[i].replace(".srx","") + "-alternative-" + k + ".srx";
56+
LOGGER.info("Looking for an alternative file called: " + alternativeAnswerFileName);
57+
File alternativeAnswerFile = new File("gsb_answers/" + alternativeAnswerFileName);
58+
if (!alternativeAnswerFile.exists()) break;
59+
else {
60+
LOGGER.info("Alternative file found: " + alternativeAnswerFileName);
61+
InputStream alternativeAnswerInputStream = new FileInputStream(alternativeAnswerFile);
62+
ByteArrayOutputStream alternativeAnswerOutputStream = new ByteArrayOutputStream();
63+
ResultSetFormatter.outputAsJSON(alternativeAnswerOutputStream, rsf.fromXML(alternativeAnswerInputStream));
64+
answers[i] = answers[i] + "======" + alternativeAnswerOutputStream.toString(); // add the detected alternative expected answer with a corresponding delimiter
65+
alternativeAnswerInputStream.close();
66+
LOGGER.info("answers[" + i + "]: " + answers[i]);
67+
}
68+
}
5369
}
5470
} catch (IOException e) {
5571
// TODO Auto-generated catch block
@@ -79,10 +95,10 @@ protected void generateTask(byte[] data) throws Exception {
7995
// Locate the corresponding query answer
8096
// and send it to the Evaluation Store for evaluation
8197
String [] parts = dataString.split("\n");
82-
String answerIndexString = parts[0].trim().substring(2);
83-
int answerIndex = Integer.parseInt(answerIndexString) - 1; // The first line is a comment denoting the query (#Q01, #Q02, ...)
98+
String answerIndexString = parts[0].trim().substring(3);
99+
int answerIndex = Integer.parseInt(answerIndexString) - 1; // The first line is a comment denoting the query (#Q-1, #Q-2, ...)
84100
String ans = answers[answerIndex];
85-
data = RabbitMQUtils.writeString("#Q0" + (answerIndex+1) + "\n\n" + ans);
101+
data = RabbitMQUtils.writeString("#Q-" + (answerIndex+1) + "\n\n" + ans);
86102
sendTaskToEvalStorage(taskIdString, timestamp, data);
87103
}
88104
}

src/main/java/org/hobbit/geosparql/systems/VirtuosoSysAda.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ public void receiveGeneratedTask(String taskId, byte[] data) {
127127
}
128128
}
129129
else {
130+
if (queryString.contains("INFERENCE")) {
131+
// Activate inference in Virtuoso
132+
queryString = "DEFINE input:inference <myset>\n" + queryString;
133+
LOGGER.info("Added an INFERENCE line to a query. This is the new query text:\n" + queryString);
134+
}
130135
QueryExecution qe = queryExecFactory.createQueryExecution(queryString);
131136
ResultSet results = null;
132137
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -201,7 +206,7 @@ public void receiveCommand(byte command, byte[] data) {
201206
try {
202207
allDataReceivedMutex.acquire();
203208
} catch (InterruptedException e) {
204-
LOGGER.error("Exception while waitting for all data for bulk load " + loadingNumber + " to be recieved.", e);
209+
LOGGER.error("Exception while waiting for all data for bulk load " + loadingNumber + " to be received.", e);
205210
}
206211
LOGGER.info("All data for bulk load " + loadingNumber + " received. Proceed to the loading...");
207212

0 commit comments

Comments
 (0)