diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-06 09:50:47 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-06 09:50:47 +0000 |
| commit | 4950c9a78eda022c5342efbc77eb1135881f11ac (patch) | |
| tree | fee9d2a7079a05851e1e0c1014e7932cf9cfb2a6 /src/main/scala | |
| parent | f8ec91676cfdeefc302100033a1b38167d01490f (diff) | |
| download | RSAComb-4950c9a78eda022c5342efbc77eb1135881f11ac.tar.gz RSAComb-4950c9a78eda022c5342efbc77eb1135881f11ac.zip | |
Add method to retrieve diagnostics from RDFox
Diffstat (limited to 'src/main/scala')
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala index 193119f..9dd52cf 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | |||
| @@ -3,6 +3,7 @@ package uk.ac.ox.cs.rsacomb.util | |||
| 3 | import java.io.StringReader | 3 | import java.io.StringReader |
| 4 | import tech.oxfordsemantic.jrdfox.Prefixes | 4 | import tech.oxfordsemantic.jrdfox.Prefixes |
| 5 | import tech.oxfordsemantic.jrdfox.client.{ | 5 | import tech.oxfordsemantic.jrdfox.client.{ |
| 6 | ComponentInfo, | ||
| 6 | ConnectionFactory, | 7 | ConnectionFactory, |
| 7 | ServerConnection, | 8 | ServerConnection, |
| 8 | DataStoreConnection, | 9 | DataStoreConnection, |
| @@ -66,6 +67,20 @@ object RDFoxUtil { | |||
| 66 | (server, data) | 67 | (server, data) |
| 67 | } | 68 | } |
| 68 | 69 | ||
| 70 | /** Gather statistics from RDFox datastore. | ||
| 71 | * | ||
| 72 | * @see [[https://docs.oxfordsemantic.tech/programmatic-access-APIs.html#in-depth-diagnostic-information]] | ||
| 73 | * and [[https://docs.oxfordsemantic.tech/programmatic-access-APIs.html#managing-statistics]] | ||
| 74 | * for more ways of gathering diagnostics from RDFox. | ||
| 75 | */ | ||
| 76 | def gatherStatistics(data: DataStoreConnection): String = { | ||
| 77 | val info = data.getComponentInfo(true) | ||
| 78 | s"${info.getName}: ${info.getPropertyValues}" | ||
| 79 | .replaceAll("\\{", "{\n ") | ||
| 80 | .replaceAll(", ", ",\n ") | ||
| 81 | .replaceAll("\\}", "\n}") | ||
| 82 | } | ||
| 83 | |||
| 69 | /** Adds a collection of rules to a data store. | 84 | /** Adds a collection of rules to a data store. |
| 70 | * | 85 | * |
| 71 | * @param data datastore connection | 86 | * @param data datastore connection |
