diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-16 16:27:41 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-16 16:27:41 +0100 |
commit | 99b932a358e0fcf5b463c3a98fb12fdfa393152c (patch) | |
tree | 9a78d5363937a2707cf516f37f48d2d0c65db5ae /src/main/scala/rsacomb/RDFoxUtil.scala | |
parent | 6fc6fc2bde597c79e66c3dbf8e3a1f94526ea672 (diff) | |
download | RSAComb-99b932a358e0fcf5b463c3a98fb12fdfa393152c.tar.gz RSAComb-99b932a358e0fcf5b463c3a98fb12fdfa393152c.zip |
Include built-in rules in RSA check
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxUtil.scala')
-rw-r--r-- | src/main/scala/rsacomb/RDFoxUtil.scala | 42 |
1 files changed, 42 insertions, 0 deletions
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 @@ | |||
1 | package rsacomb | ||
2 | |||
3 | /* Java imports */ | ||
4 | import java.util.HashMap | ||
5 | import tech.oxfordsemantic.jrdfox.client.{ | ||
6 | ConnectionFactory, | ||
7 | ServerConnection, | ||
8 | DataStoreConnection | ||
9 | } | ||
10 | |||
11 | object RDFoxUtil { | ||
12 | |||
13 | def openConnection( | ||
14 | dataStore: String | ||
15 | ): (ServerConnection, DataStoreConnection) = { | ||
16 | /* Create local server connection | ||
17 | */ | ||
18 | val serverUrl = "rdfox:local" | ||
19 | val role = "" | ||
20 | val password = "" | ||
21 | val server = | ||
22 | ConnectionFactory.newServerConnection(serverUrl, role, password) | ||
23 | |||
24 | /* Create datastore connection | ||
25 | */ | ||
26 | val parameters = new HashMap[String, String]() | ||
27 | //parameters.put("equality", "noUNA") | ||
28 | server.createDataStore(dataStore, "seq", parameters) | ||
29 | val data = server.newDataStoreConnection(dataStore) | ||
30 | |||
31 | (server, data) | ||
32 | } | ||
33 | |||
34 | def closeConnection( | ||
35 | server: ServerConnection, | ||
36 | data: DataStoreConnection | ||
37 | ): Unit = { | ||
38 | server.close(); | ||
39 | data.close(); | ||
40 | } | ||
41 | |||
42 | } // object RDFox | ||