From 99b932a358e0fcf5b463c3a98fb12fdfa393152c Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sun, 16 Aug 2020 16:27:41 +0100 Subject: Include built-in rules in RSA check --- src/main/scala/rsacomb/RDFoxUtil.scala | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/main/scala/rsacomb/RDFoxUtil.scala (limited to 'src/main/scala/rsacomb/RDFoxUtil.scala') diff --git a/src/main/scala/rsacomb/RDFoxUtil.scala b/src/main/scala/rsacomb/RDFoxUtil.scala new file mode 100644 index 0000000..96710c4 --- /dev/null +++ b/src/main/scala/rsacomb/RDFoxUtil.scala @@ -0,0 +1,42 @@ +package rsacomb + +/* Java imports */ +import java.util.HashMap +import tech.oxfordsemantic.jrdfox.client.{ + ConnectionFactory, + ServerConnection, + DataStoreConnection +} + +object RDFoxUtil { + + def openConnection( + dataStore: String + ): (ServerConnection, DataStoreConnection) = { + /* Create local server connection + */ + val serverUrl = "rdfox:local" + val role = "" + val password = "" + val server = + ConnectionFactory.newServerConnection(serverUrl, role, password) + + /* Create datastore connection + */ + val parameters = new HashMap[String, String]() + //parameters.put("equality", "noUNA") + server.createDataStore(dataStore, "seq", parameters) + val data = server.newDataStoreConnection(dataStore) + + (server, data) + } + + def closeConnection( + server: ServerConnection, + data: DataStoreConnection + ): Unit = { + server.close(); + data.close(); + } + +} // object RDFox -- cgit v1.2.3