result = ana.executeQuery(eps, sparqlQuery);
+ long endTime = System.nanoTime();
+ long duration = (endTime - startTime) / 1000000;
+ if (i == 0) {
+ System.out.println("First execution time: " + duration + " millisecond.");
+ for (BindingSet element : result) {
+ System.out.println(element);
+ }
+ }
+ totatl_duration += duration;
+
+ }
+
+ System.out.println("Processing Time: " + totatl_duration / iteration + " millisecond");
+
+ }
+}
diff --git a/JPS_BASE_LIB/src/main/java/uk/ac/cam/cares/jps/base/query/fedq/stopcps.json b/JPS_BASE_LIB/src/main/java/uk/ac/cam/cares/jps/base/query/fedq/stopcps.json
new file mode 100644
index 00000000000..7786b3ca3d2
--- /dev/null
+++ b/JPS_BASE_LIB/src/main/java/uk/ac/cam/cares/jps/base/query/fedq/stopcps.json
@@ -0,0 +1,12 @@
+{
+ "classes":[
+ "http://www.w3.org/2002/07/owl#Ontology",
+ "http://www.w3.org/2002/07/owl#Class",
+ "http://www.w3.org/2002/07/owl#NamedIndividual"
+ ],
+ "properties":[
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
+ "http://www.w3.org/2000/01/rdf-schema#label",
+ "http://www.w3.org/2000/01/rdf-schema#comment"
+ ]
+}
\ No newline at end of file
diff --git a/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/query/RemoteStoreClientTest.java b/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/query/RemoteStoreClientTest.java
index b0debba9eed..24268e4f42b 100644
--- a/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/query/RemoteStoreClientTest.java
+++ b/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/query/RemoteStoreClientTest.java
@@ -27,10 +27,14 @@
import org.mockito.Mockito;
import uk.ac.cam.cares.jps.base.exception.JPSRuntimeException;
+import uk.ac.cam.cares.jps.base.query.fedq.BuildInvertedIndex;
+import uk.ac.cam.cares.jps.base.query.fedq.FedqIndex;
/**
- * This class covers both unit tests and regression tests on RemoteStoreClient,
- * which is designed to perform query and update operations on virtually any
+ * This class covers both unit tests and regression tests on RemoteStoreClient,
+ *
+ * which is designed to perform query and update operations on virtually any
+ *
* SPARQL Endpoints.
*
* @author Feroz Farazi (msff2@cam.ac.uk)
@@ -42,49 +46,56 @@ public class RemoteStoreClientTest {
String updateEndpoint = "http://localhost:8080/blazegraph/namespace/ontokin/sparql";
String userName = "user";
String password = "password";
-
+
/**
- * Verifies if the StoreClient constructor that is designed to
- * set the query endpoint (URL) assigns the value to the corresponding
- * member variable.
+ * Verifies if the StoreClient constructor that is designed to
+ *
+ * set the query endpoint (URL) assigns the value to the corresponding
+ *
+ * member variable.
*
* @throws SQLException
*/
@Test
- public void queryEndpointSetupTest() throws SQLException{
+ public void queryEndpointSetupTest() throws SQLException {
RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint);
assertNotNull(kbClient.getQueryEndpoint());
assertEquals(queryEndpoint, kbClient.getQueryEndpoint());
}
-
+
/**
- * Verifies if the StoreClient constructor that is designed to
- * set both the query and update endpoints (URLs) assigns the values to
- * the corresponding member variables.
+ * Verifies if the StoreClient constructor that is designed to
+ *
+ * set both the query and update endpoints (URLs) assigns the values to
+ *
+ * the corresponding member variables.
*
* @throws SQLException
*/
@Test
- public void queryAndUpdateEndpointsSetupTest() throws SQLException{
+ public void queryAndUpdateEndpointsSetupTest() throws SQLException {
RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint, updateEndpoint);
assertNotNull(kbClient.getQueryEndpoint());
assertNotNull(kbClient.getUpdateEndpoint());
assertEquals(updateEndpoint, kbClient.getQueryEndpoint());
assertEquals(queryEndpoint, kbClient.getUpdateEndpoint());
}
-
+
/**
- * Checks if the StoreClient constructor that is designed to
- * set the query and update endpoints (URLs) and query assigns the values
- * to the corresponding member variables.
+ * Checks if the StoreClient constructor that is designed to
+ *
+ * set the query and update endpoints (URLs) and query assigns the values
+ *
+ * to the corresponding member variables.
*
* @throws SQLException
*/
@Test
- public void endpointsAndQuerySetupTest() throws SQLException{
+ public void endpointsAndQuerySetupTest() throws SQLException {
userName = "user";
password = "password";
- RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint, updateEndpoint, formMechanismCountQuery(), userName, password);
+ RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint, updateEndpoint, formMechanismCountQuery(),
+ userName, password);
assertNotNull(kbClient.getQueryEndpoint());
assertNotNull(kbClient.getUpdateEndpoint());
assertNotNull(kbClient.getQuery());
@@ -110,7 +121,7 @@ public void endpointsAndQuerySetupTest() throws SQLException{
assertEquals(updateEndpoint, kbClient.getUpdateEndpoint());
assertEquals(formInsertQuery(), kbClient.getQuery());
}
-
+
@Test
public void testIsUpdateEndpointBlazegraphBackended() {
queryEndpoint = "/test/Query/Endpoint";
@@ -133,14 +144,16 @@ public void testIsUpdateEndpointBlazegraphBackended() {
kbClient = new RemoteStoreClient(queryEndpoint, updateEndpoint);
assertTrue(!kbClient.isUpdateEndpointBlazegraphBackended());
}
+
/**
- * Checks if the connection URL established for the update endpoint (URL)
+ * Checks if the connection URL established for the update endpoint (URL)
+ *
* is the expected one.
*
* @throws SQLException
*/
@Test
- public void connectionURLForUpdateEndpointTest() throws SQLException{
+ public void connectionURLForUpdateEndpointTest() throws SQLException {
String updateEndpoint = "http://localhost:8080/test";
RemoteStoreClient kbClient = new RemoteStoreClient();
kbClient.setUpdateEndpoint(updateEndpoint);
@@ -148,40 +161,42 @@ public void connectionURLForUpdateEndpointTest() throws SQLException{
assertEquals("jdbc:jena:remote:update=".concat(updateEndpoint), kbClient.getConnectionUrl());
}
-
-
/**
- * Checks if the connection URL established for the query endpoint (URL)
- * is the expected one.
+ * Checks if the connection URL established for the query endpoint (URL)
+ *
+ * is the expected one.
*
* @throws SQLException
*/
@Test
- public void connectionURLForQueryEndpointTest() throws SQLException{
+ public void connectionURLForQueryEndpointTest() throws SQLException {
queryEndpoint = "http://localhost:8080/test";
RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint);
assertNotNull(kbClient.getConnectionUrl());
assertEquals("jdbc:jena:remote:query=".concat(queryEndpoint), kbClient.getConnectionUrl());
}
-
+
/**
- * Checks if the connection URL established for the query and update
- * endpoints (URLs) is the expected one.
+ * Checks if the connection URL established for the query and update
+ *
+ * endpoints (URLs) is the expected one.
*
* @throws SQLException
*/
@Test
- public void connectionURLForQueryAndInsertEndpointsTest() throws SQLException{
+ public void connectionURLForQueryAndInsertEndpointsTest() throws SQLException {
queryEndpoint = "http://localhost:8080/test";
updateEndpoint = "http://localhost:8080/test";
RemoteStoreClient kbClient = new RemoteStoreClient(queryEndpoint, updateEndpoint);
assertNotNull(kbClient.getConnectionUrl());
- assertEquals("jdbc:jena:remote:query=".concat(queryEndpoint).concat("&update=").concat(updateEndpoint), kbClient.getConnectionUrl());
+ assertEquals("jdbc:jena:remote:query=".concat(queryEndpoint).concat("&update=").concat(updateEndpoint),
+ kbClient.getConnectionUrl());
}
-
+
/**
- * Checks if the connection URL established for the query endpoint and
- * update endpoint for deletion is the expected one.
+ * Checks if the connection URL established for the query endpoint and
+ *
+ * update endpoint for deletion is the expected one.
*
* @throws SQLException
*/
@@ -194,15 +209,15 @@ public void connectionURLForQueryAndDeleteEndpointsTest() throws SQLException {
assertEquals("jdbc:jena:remote:query=".concat(queryEndpoint).concat("&update=").concat(updateEndpoint),
kbClient.getConnectionUrl());
}
-
+
/**
* Verifies the validity of both the query URL and update URL.
- * For example, standard protocols for URL, i.e. http and https are supported.
+ * For example, standard protocols for URL, i.e. http and https are supported.
*
* @throws SQLException
*/
@Test
- public void connectionHttpURLTest() throws SQLException{
+ public void connectionHttpURLTest() throws SQLException {
// Tests the query endpoint
queryEndpoint = "http://localhost:8080/blazegraph/namespace/ontokin/sparql";
RemoteStoreClient rKBClient = new RemoteStoreClient(queryEndpoint);
@@ -213,7 +228,7 @@ public void connectionHttpURLTest() throws SQLException{
queryEndpoint = "httpss://localhost:8080/blazegraph/namespace/ontokin/sparql";
rKBClient = new RemoteStoreClient(queryEndpoint);
assertFalse(rKBClient.isConnectionQueryUrlValid(rKBClient.getConnectionUrl()));
- // Tests the update endpoint with the update URL only
+ // Tests the update endpoint with the update URL only
updateEndpoint = "http://localhost:8080/blazegraph/namespace/ontokin/sparql";
rKBClient = new RemoteStoreClient();
rKBClient.setUpdateEndpoint(updateEndpoint);
@@ -240,15 +255,15 @@ public void connectionHttpURLTest() throws SQLException{
rKBClient = new RemoteStoreClient(queryEndpoint, updateEndpoint);
assertFalse(rKBClient.isConnectionUpdateUrlValid(rKBClient.getConnectionUrl()));
}
-
+
/**
* Verifies the validity of connection URL consisting of a query URL,
- * user name and password.
+ * user name and password.
*
* @throws SQLException
*/
@Test
- public void connectionHttpUrlWithAuthTest() throws SQLException{
+ public void connectionHttpUrlWithAuthTest() throws SQLException {
userName = "user";
password = "password";
queryEndpoint = "http://localhost:8080/blazegraph/namespace/ontokin/sparql";
@@ -256,18 +271,24 @@ public void connectionHttpUrlWithAuthTest() throws SQLException{
remoteKBClient.setQueryEndpoint(queryEndpoint);
remoteKBClient.setUser(userName);
remoteKBClient.setPassword(password);
- assertEquals("jdbc:jena:remote:query=".concat(queryEndpoint).concat("&user=").concat(userName).concat("&password=").concat(password),
+ assertEquals(
+ "jdbc:jena:remote:query=".concat(queryEndpoint).concat("&user=").concat(userName).concat("&password=")
+ .concat(password),
remoteKBClient.getConnectionUrl());
}
-
+
/**
- * Tests if the HTTP request to run a federated SPARQL query returns the expected
- * result. It also verifies if the mock service created for this test
+ * Tests if the HTTP request to run a federated SPARQL query returns the
+ * expected
+ *
+ * result. It also verifies if the mock service created for this test
+ *
* executes the correct method.
- * @throws Exception
+ *
+ * @throws Exception
*/
@Test
- public void performMechanismCountQueryTest() throws Exception{
+ public void performMechanismCountQueryTest() throws Exception {
RemoteStoreClient kbClient = mock(RemoteStoreClient.class);
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
@@ -286,14 +307,16 @@ public void performMechanismCountQueryTest() throws Exception{
}
/**
- * Tests if the HTTP request to run a SPARQL query returns the expected
- * result. It also verifies if the mock service created for this test
+ * Tests if the HTTP request to run a SPARQL query returns the expected
+ *
+ * result. It also verifies if the mock service created for this test
+ *
* executes the correct method.
*
* @throws SQLException
*/
@Test
- public void performFederatedQueryTest() throws SQLException{
+ public void performFederatedQueryTest() throws SQLException {
RemoteStoreClient kbClient = mock(RemoteStoreClient.class);
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
@@ -306,59 +329,62 @@ public void performFederatedQueryTest() throws SQLException{
verify(kbClient).execute(formMechanismCountQuery());
}
-
/**
* Test insert
*/
@Test
public void testInsert() {
-
- String content =
- "\r\n"+
- " \r\n"+
- "\r\n";
-
+
+ String content = "\r\n" +
+ " \r\n"
+ +
+ "\r\n";
+
RemoteStoreClient kbClient = Mockito.spy(RemoteStoreClient.class);
Mockito.doReturn(1).when(kbClient).executeUpdate(any(UpdateRequest.class));
-
+
kbClient.insert(null, content, null);
-
+
Mockito.verify(kbClient).insert(null, content, null);
Mockito.verify(kbClient).executeUpdate(any(UpdateRequest.class));
}
-
+
/**
* Test get method
*/
@Test
public void testGet() {
-
- String actual =
- ""+System.getProperty("line.separator")+
- " "+System.getProperty("line.separator")+
- ""+System.getProperty("line.separator");
-
- //mock result
+
+ String actual = ""
+ + System.getProperty("line.separator") +
+ " "
+ + System.getProperty("line.separator") +
+ "" + System.getProperty("line.separator");
+
+ // mock result
Model model = ModelFactory.createDefaultModel();
- Statement s = ResourceFactory.createStatement(ResourceFactory.createResource("http://www.theworldavatar.com/kb/sgp/singapore/wastenetwork/FoodCourt-001.owl#FoodCourt-001"),
- ResourceFactory.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), ResourceFactory.createResource("http://www.theworldavatar.com/ontology/ontowaste/OntoWaste.owl#FoodCourt"));
+ Statement s = ResourceFactory.createStatement(
+ ResourceFactory.createResource(
+ "http://www.theworldavatar.com/kb/sgp/singapore/wastenetwork/FoodCourt-001.owl#FoodCourt-001"),
+ ResourceFactory.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), ResourceFactory
+ .createResource("http://www.theworldavatar.com/ontology/ontowaste/OntoWaste.owl#FoodCourt"));
model.add(s);
-
+
RemoteStoreClient kbClient = Mockito.spy(RemoteStoreClient.class);
Mockito.doReturn(model).when(kbClient).executeConstruct(any(Query.class));
-
+
String resourceUrl = null;
String accept = null;
-
+
String result = kbClient.get(resourceUrl, accept);
-
+
verify(kbClient).get(resourceUrl, accept);
verify(kbClient).executeConstruct(any(Query.class));
-
+
assertEquals(result, actual);
}
@@ -384,15 +410,15 @@ public void testExecuteQueryAndUpdateException() {
*
* @return
*/
- private static String formMechanismCountQuery(){
+ private static String formMechanismCountQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("SELECT ?x \n");
- query = query.concat("WHERE\n");
- query = query.concat("{\n");
- query = query.concat("?x rdf:type ontokin:ReactionMechanism .\n");
- query = query.concat("}\n");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat("SELECT ?x \n");
+ query = query.concat("WHERE\n");
+ query = query.concat("{\n");
+ query = query.concat("?x rdf:type ontokin:ReactionMechanism .\n");
+ query = query.concat("}\n");
+ return query;
}
/**
@@ -400,65 +426,69 @@ private static String formMechanismCountQuery(){
*
* @return
*/
- private static String formMechanismIRIsQuery(){
+ private static String formMechanismIRIsQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("SELECT ?x \n");
- query = query.concat("WHERE\n");
- query = query.concat("{\n");
- query = query.concat("?x rdf:type ontokin:ReactionMechanism .\n");
- query = query.concat("} LIMIT 10\n");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat("SELECT ?x \n");
+ query = query.concat("WHERE\n");
+ query = query.concat("{\n");
+ query = query.concat("?x rdf:type ontokin:ReactionMechanism .\n");
+ query = query.concat("} LIMIT 10\n");
+ return query;
}
-
/**
* A SPARQL query to retrieve the IRIs of all mechanisms in a repository.
*
* @return
*/
- private static String formAnyTriplesQuery(){
+ private static String formAnyTriplesQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("SELECT ?x ?y ?z \n");
- query = query.concat("WHERE\n");
- query = query.concat("{\n");
- query = query.concat("?x ?y ?z .\n");
- query = query.concat("} LIMIT 10\n");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat("SELECT ?x ?y ?z \n");
+ query = query.concat("WHERE\n");
+ query = query.concat("{\n");
+ query = query.concat("?x ?y ?z .\n");
+ query = query.concat("} LIMIT 10\n");
+ return query;
}
-
- private static String formInsertQuery(){
+
+ private static String formInsertQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("INSERT DATA { ontokin:hasTemperatureExponent \"-0.7\" }");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat(
+ "INSERT DATA { ontokin:hasTemperatureExponent \"-0.7\" }");
+ return query;
}
-
- private static String formTempExponentQuery(){
+
+ private static String formTempExponentQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("SELECT ?tempExponent\n");
- query = query.concat("WHERE\n");
- query = query.concat("{\n");
- query = query.concat(" ontokin:hasTemperatureExponent ?tempExponent .\n");
- query = query.concat("}");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat("SELECT ?tempExponent\n");
+ query = query.concat("WHERE\n");
+ query = query.concat("{\n");
+ query = query.concat(
+ " ontokin:hasTemperatureExponent ?tempExponent .\n");
+ query = query.concat("}");
+ return query;
}
-
- private static String formDeleteQuery(){
+
+ private static String formDeleteQuery() {
String query = "PREFIX ontokin: \n";
- query = query.concat("PREFIX rdf: \n");
- query = query.concat("DELETE DATA { ontokin:hasTemperatureExponent \"-0.7\" }");
- return query;
+ query = query.concat("PREFIX rdf: \n");
+ query = query.concat(
+ "DELETE DATA { ontokin:hasTemperatureExponent \"-0.7\" }");
+ return query;
}
-
+
/**
- * A federated query developed to eqecute against the endpoints of OntoSpecies and OntoCompChem Knowledge Bases.
+ * A federated query developed to eqecute against the endpoints of OntoSpecies
+ * and OntoCompChem Knowledge Bases.
+ *
* @return
*/
public static String formFederatedQuery() {
- String query ="PREFIX OntoSpecies: "
+ String query = "PREFIX OntoSpecies: "
+ "PREFIX ontocompchem: "
+ "PREFIX gc: "
+ "SELECT DISTINCT ?species ?compchemspecies ?crid ?atomicBond ?geometry ?enthalpyOfFormationValue ?scfEnergyValue ?zeroEnergyValue "
@@ -478,19 +508,19 @@ public static String formFederatedQuery() {
+ "?zeroEnergy gc:hasElectronicEnergy ?zeroElectronicEnergy . "
+ "?zeroElectronicEnergy gc:hasValue ?zeroEnergyValue . "
+ "}";
-
+
return query;
}
/**
* A federated query developed to execute against the endpoints of
* OntoSpecies and OntoCompChem Knowledge Bases to retrieve partial
- * details of species.
- *
+ * details of species.
+ *
* @return
*/
public static String formFederatedQuery2() {
- String query ="PREFIX OntoSpecies: "
+ String query = "PREFIX OntoSpecies: "
+ "PREFIX ontocompchem: "
+ "PREFIX gc: "
+ "SELECT * "
@@ -506,25 +536,110 @@ public static String formFederatedQuery2() {
+ "?zeroEnergy gc:hasElectronicEnergy ?zeroElectronicEnergy . "
+ "?zeroElectronicEnergy gc:hasValue ?zeroEnergyValue . "
+ "}";
-
+
+ return query;
+ }
+
+ /**
+ * A federated query developed to execute against the endpoints of
+ * OntoSpecies and OntoCompChem Knowledge Bases to retrieve partial
+ * details of species.
+ *
+ * @return
+ */
+ public static String formFederatedQuery3() {
+ String query = "PREFIX OntoSpecies: "
+ + "PREFIX ontocompchem: "
+ + "PREFIX gc: "
+ + "SELECT * "
+ + "WHERE { "
+ + "?x ?y ?z ."
+ + "} LIMIT 10";
+
return query;
}
- public static void main(String[] args){
+ public static String formFederatedQuery4() {
+ String sparqlQuery = """
+ PREFIX rdf:
+ PREFIX owl:
+ PREFIX pt:
+ PREFIX OntoKin:
+ PREFIX rdfs:
+
+ SELECT DISTINCT ?identifier ?atomicMass ?atomicMassUnits
+ WHERE {
+ ?element1 rdf:type pt:Element .
+ BIND(STRAFTER(STR(?element1), \"#\") AS ?identifier)
+ ?element2 rdf:type OntoKin:Element .
+ ?element2 rdfs:label ?identifier1 .
+ ?element2 OntoKin:hasAtomicMass ?atomicMass .
+ ?element2 OntoKin:hasAtomicMassUnits ?atomicMassUnits .
+ FILTER(?identifier = ?identifier1)
+ }
+ """;
+
+ return sparqlQuery;
+ }
+
+ public static void createIndex() {
+
+ String endpoints[] = { "http://localhost:8080/blazegraph/namespace/namespace_kin/sparql",
+ "http://localhost:8080/blazegraph/namespace/namespace_compchem/sparql",
+ "http://localhost:8080/blazegraph/namespace/namespace_automotive/sparql",
+ "http://localhost:8080/blazegraph/namespace/namespace_species/sparql",
+ "http://localhost:8080/blazegraph/namespace/namespace_uken/sparql"
+ };
+
+ FedqIndex fqi = new FedqIndex("C:/Users/printer_admin/Downloads/KGs/20241030");
+
+ for (String endpointUrl : endpoints) {
+ System.out.println("Start processing endpoint: " + endpointUrl);
+ fqi.createInvertedIndex(endpointUrl);
+ }
+
+ fqi.saveIndices();
+ System.out.println("Completed and index-files are saved.");
+ }
+
+ public static void extendIndex(String endpointUrl) {
+
+ FedqIndex fqi = new FedqIndex("C:/Users/printer_admin/Downloads/KGs/20241030");
+ fqi.loadIndices();
+
+ System.out.println("Start processing endpoint: " + endpointUrl);
+ fqi.createInvertedIndex(endpointUrl);
+
+ fqi.saveIndices();
+ System.out.println("Completed and index-files are saved.");
+ }
+
+ public static void main(String[] args) {
+ // createIndex();
+
+ // extendIndex("http://localhost:8080/blazegraph/namespace/uken_1m/sparql");
+ // extendIndex("http://localhost:8080/blazegraph/namespace/uken_10m/sparql");
+ // extendIndex("http://localhost:8080/blazegraph/namespace/uken_200m/sparql");
+
RemoteStoreClient kbClient = new RemoteStoreClient();
- List endpoints = new ArrayList<>();
- String queryEndpointOntoSpeciesKB = "http://www.theworldavatar.com/blazegraph/namespace/ontospecies/sparql";
- String queryEndpointOntoCompChemKB = "http://www.theworldavatar.com/blazegraph/namespace/ontocompchem/sparql";
- endpoints.add(queryEndpointOntoSpeciesKB);
- endpoints.add(queryEndpointOntoCompChemKB);
+ FedqIndex fii = new FedqIndex("C:/Users/printer_admin/Downloads/KGs/20241030");
+ fii.loadIndices();
+ fii.extractClassesAndProperties(formFederatedQuery4());
+
+ List endpoints = new ArrayList<>(fii.getEndpoints());
+ // String queryEndpointOntoSpeciesKB =
+ // "http://localhost:8080/blazegraph/namespace/namespace_all/sparql";
+ // endpoints.add(queryEndpointOntoSpeciesKB);
+
try {
- JSONArray result = kbClient.executeFederatedQuery(endpoints, formFederatedQuery2());
+ JSONArray result = kbClient.executeFederatedQuery(endpoints,
+ formFederatedQuery4());
System.out.println(result.toString());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
-
+
}
diff --git a/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/timeseries/TimeSeriesRDBClientIntegrationTest.java b/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/timeseries/TimeSeriesRDBClientIntegrationTest.java
index 8d08596a5b6..2137c9ec2d2 100644
--- a/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/timeseries/TimeSeriesRDBClientIntegrationTest.java
+++ b/JPS_BASE_LIB/src/test/java/uk/ac/cam/cares/jps/base/timeseries/TimeSeriesRDBClientIntegrationTest.java
@@ -12,6 +12,7 @@
import java.util.OptionalDouble;
import org.jooq.*;
+import org.jooq.Record;
import org.junit.*;
import org.jooq.impl.DSL;
import static org.jooq.impl.DSL.selectFrom;