diff options
-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 |