Skip to content

Commit

Permalink
Add additional data to change behavior of optimizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Dec 1, 2023
1 parent 5a87361 commit 7be9238
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.repository.util.RepositoryUtil;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.sail.memory.MemoryStore;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;

public class ServiceTest {
private Repository repository;

Expand All @@ -38,6 +42,14 @@ public FederatedService createService(String url) {
});

sailRepository.init();

// the following data influences the query optimizer somehow
try (RepositoryConnection connection = sailRepository.getConnection()) {
connection.add(getClass().getResource("/META-INF/ontologies/rdfs.rdf"), RDFFormat.RDFXML);
} catch (IOException e) {
e.printStackTrace();
}

this.repository = sailRepository;
}

Expand Down Expand Up @@ -70,7 +82,7 @@ public void findNameplateTest() {
"{ select ?shell { <aas-api:endpoint> <aas-api:shells> ?shell } limit 2 } " +
"?shell aas:submodels ?sm . ?sm aas:semanticId ?semId . ?semId aas:keys [ !<:> ?key ] . " +
"?key aas:value \"https://admin-shell.io/zvei/nameplate/1/0/Nameplate\" . " +
"?sm (!<:>)+ ?element . " +
"?sm !<:> ?element . " +
"{ ?element a aas:Property } union { ?element a aas:MultiLanguageProperty } " +
"?element ?p ?o . " +
"} " +
Expand Down

0 comments on commit 7be9238

Please sign in to comment.