diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-08 17:50:57 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-01-08 17:50:57 +0000 |
| commit | 35f41c0529f65c4b3ee941e087d497a931d17d9e (patch) | |
| tree | ab950ccc9a3457a4c60b0d4941dd080301cca13f | |
| parent | b0e195336a950095a733f32bf07754254ed08a37 (diff) | |
| download | RSAComb-35f41c0529f65c4b3ee941e087d497a931d17d9e.tar.gz RSAComb-35f41c0529f65c4b3ee941e087d497a931d17d9e.zip | |
Add sbt plugin to create jar with dependences
Also update README.md with info on how to compile and run the program.
| -rw-r--r-- | README.md | 33 | ||||
| -rw-r--r-- | build.sbt | 40 | ||||
| -rw-r--r-- | project/Dependencies.scala | 9 | ||||
| -rw-r--r-- | project/plugins.sbt | 1 |
4 files changed, 69 insertions, 14 deletions
| @@ -11,19 +11,42 @@ In order to use this program you need to have [RDFox](https://www.oxfordsemantic | |||
| 11 | RDFox is proprietary software and as such we are not able to distribute it along with our code. | 11 | RDFox is proprietary software and as such we are not able to distribute it along with our code. |
| 12 | Please refer to [this link](https://www.oxfordsemantic.tech/tryrdfoxforfree) to request a free trial. | 12 | Please refer to [this link](https://www.oxfordsemantic.tech/tryrdfoxforfree) to request a free trial. |
| 13 | 13 | ||
| 14 | This software has been developed and tested with RDFox v.4.0 | 14 | This software has been developed and tested with RDFox v.4.1 |
| 15 | 15 | ||
| 16 | ## Using the software | 16 | ## Using the software |
| 17 | 17 | ||
| 18 | TODO | 18 | We assume you followed [these steps](https://docs.oxfordsemantic.tech/getting-started.html#getting-started) in order to setup RDFox on your personal machine and in particular you know the path to the `JRDFox.jar` library that comes with the distribution. |
| 19 | 19 | ||
| 20 | ### Provide RDFox license | 20 | ### Provide RDFox license |
| 21 | 21 | ||
| 22 | TODO | 22 | The [documentation](https://docs.oxfordsemantic.tech/features-and-requirements.html#license-key), describes several ways to provide the license to RDFox. |
| 23 | 23 | ||
| 24 | ### Compiling the project | 24 | One easy way is to put your license key in a file `RDFox.lic` in `$HOME/.RDFox/`, with adeguate read permissions for the user executing the program. |
| 25 | 25 | ||
| 26 | TODO | 26 | ### Compiling and running the project |
| 27 | |||
| 28 | The project uses [sbt](https://www.scala-sbt.org/) to manage dependences. | ||
| 29 | |||
| 30 | To compile the project run the following from the base directory: | ||
| 31 | ``` | ||
| 32 | sbt compile | ||
| 33 | ``` | ||
| 34 | |||
| 35 | The project uses the sbt plugin [sbt-assembly](https://github.com/sbt/sbt-assembly) to produce a fat jar with all the required dependences. | ||
| 36 | Run the following from the base directory of the project to produce a standalone `jar` file. | ||
| 37 | ``` | ||
| 38 | sbt assembly | ||
| 39 | ``` | ||
| 40 | |||
| 41 | The output of the command will print the location of the produced jar. Execute it with | ||
| 42 | ``` | ||
| 43 | java -jar <path/to/fat.jar> [<option> ...] | ||
| 44 | ``` | ||
| 45 | |||
| 46 | Note that the fat jar file distributed with this repository excludes the RDFox as a dependency. Provided that you have the RDFox setup on your machine, you can run the program as follows | ||
| 47 | ``` | ||
| 48 | java -cp <path/to/JRDFox.jar>:<path/to/fat.jar> uk.ac.ox.cs.rsacomb.RSAComb [<option> ...] | ||
| 49 | ``` | ||
| 27 | 50 | ||
| 28 | ### Running tests and examples | 51 | ### Running tests and examples |
| 29 | 52 | ||
| @@ -1,10 +1,10 @@ | |||
| 1 | import Dependencies._ | 1 | import Dependencies._ |
| 2 | 2 | ||
| 3 | ThisBuild / scalaVersion := "2.13.4" | 3 | ThisBuild / scalaVersion := "2.13.4" |
| 4 | ThisBuild / version := "0.1.0" | 4 | ThisBuild / version := "0.1.0" |
| 5 | ThisBuild / organization := "uk.ac.ox.cs.rsacomb" | 5 | ThisBuild / organization := "uk.ac.ox.cs.rsacomb" |
| 6 | ThisBuild / organizationName := "Department of Computer Science - University of Oxford" | 6 | ThisBuild / organizationName := "Department of Computer Science - University of Oxford" |
| 7 | ThisBuild / organizationHomepage := Some(url("https://www.cs.ox.ac.uk")) | 7 | ThisBuild / organizationHomepage := Some(url("https://www.cs.ox.ac.uk")) |
| 8 | 8 | ||
| 9 | ThisBuild / scmInfo := Some( | 9 | ThisBuild / scmInfo := Some( |
| 10 | ScmInfo( | 10 | ScmInfo( |
| @@ -23,7 +23,9 @@ ThisBuild / scmInfo := Some( | |||
| 23 | 23 | ||
| 24 | ThisBuild / description := "Re-implementation of the combined approach for CQ answering over RSA ontologies." | 24 | ThisBuild / description := "Re-implementation of the combined approach for CQ answering over RSA ontologies." |
| 25 | // ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")) | 25 | // ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")) |
| 26 | ThisBuild / homepage := Some(url("https://github.com/KRR-Oxford/RSA-combined-approach")) | 26 | ThisBuild / homepage := Some( |
| 27 | url("https://github.com/KRR-Oxford/RSA-combined-approach") | ||
| 28 | ) | ||
| 27 | 29 | ||
| 28 | lazy val root = (project in file(".")) | 30 | lazy val root = (project in file(".")) |
| 29 | .settings( | 31 | .settings( |
| @@ -36,3 +38,29 @@ lazy val root = (project in file(".")) | |||
| 36 | graphcore | 38 | graphcore |
| 37 | ) | 39 | ) |
| 38 | ) | 40 | ) |
| 41 | |||
| 42 | /** Exclude RDFox from the building process | ||
| 43 | * | ||
| 44 | * @see https://github.com/sbt/sbt-assembly#excluding-jars-and-files | ||
| 45 | * for different ways to exclude a specific package from the building | ||
| 46 | * process. | ||
| 47 | */ | ||
| 48 | assemblyExcludedJars in assembly := { | ||
| 49 | val cp = (fullClasspath in assembly).value | ||
| 50 | cp filter { _.data.getName == "JRDFox.jar" } | ||
| 51 | } | ||
| 52 | |||
| 53 | /** See these links for more info on merging strategies in | ||
| 54 | * `sbt-assembly` | ||
| 55 | * | ||
| 56 | * https://github.com/sbt/sbt-assembly#merge-strategy | ||
| 57 | * https://stackoverflow.com/a/55557287 | ||
| 58 | */ | ||
| 59 | assemblyMergeStrategy in assembly := { | ||
| 60 | case "module-info.class" => | ||
| 61 | MergeStrategy.discard | ||
| 62 | case x => { | ||
| 63 | val oldStrategy = (assemblyMergeStrategy in assembly).value | ||
| 64 | oldStrategy(x) | ||
| 65 | } | ||
| 66 | } | ||
diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 39e8e2e..a185615 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala | |||
| @@ -8,8 +8,11 @@ object Dependencies { | |||
| 8 | 8 | ||
| 9 | // Libraries | 9 | // Libraries |
| 10 | val scalatest = "org.scalatest" %% "scalatest" % scalatestVersion | 10 | val scalatest = "org.scalatest" %% "scalatest" % scalatestVersion |
| 11 | val scalatestFlatSpec = "org.scalatest" %% "scalatest-flatspec" % scalatestVersion | 11 | val scalatestFlatSpec = |
| 12 | val scalatestShouldMatchers = "org.scalatest" %% "scalatest-shouldmatchers" % scalatestVersion | 12 | "org.scalatest" %% "scalatest-flatspec" % scalatestVersion |
| 13 | val apibinding = "net.sourceforge.owlapi" % "owlapi-apibinding" % owlapiVersion | 13 | val scalatestShouldMatchers = |
| 14 | "org.scalatest" %% "scalatest-shouldmatchers" % scalatestVersion | ||
| 15 | val apibinding = | ||
| 16 | "net.sourceforge.owlapi" % "owlapi-apibinding" % owlapiVersion | ||
| 14 | val graphcore = "org.scala-graph" %% "graph-core" % scalagraphVersion | 17 | val graphcore = "org.scala-graph" %% "graph-core" % scalagraphVersion |
| 15 | } | 18 | } |
diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 0000000..72477a2 --- /dev/null +++ b/project/plugins.sbt | |||
| @@ -0,0 +1 @@ | |||
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") | |||
