aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/uk/ac/ox/cs
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2021-02-04 10:41:09 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2021-02-04 10:41:09 +0000
commit1cb2165ccbcd6b1210bee1dfb7b527b4d2440901 (patch)
tree878e6666433d15cc48c23cdc4c4d7c8770a39411 /src/test/scala/uk/ac/ox/cs
parentb9fe66ed1b48d21f3fe6cb960c8fbe8f22f4a39c (diff)
downloadRSAComb-1cb2165ccbcd6b1210bee1dfb7b527b4d2440901.tar.gz
RSAComb-1cb2165ccbcd6b1210bee1dfb7b527b4d2440901.zip
Add versioning system for different versions of code
Later on this will allow us to select the algorithm from the command line and compare performance easily.
Diffstat (limited to 'src/test/scala/uk/ac/ox/cs')
-rw-r--r--src/test/scala/uk/ac/ox/cs/rsacomb/SuiteAll.scala33
-rw-r--r--src/test/scala/uk/ac/ox/cs/rsacomb/filtering/FilteringProgramSpecs.scala (renamed from src/test/scala/uk/ac/ox/cs/rsacomb/FilteringProgramSpecs.scala)20
2 files changed, 32 insertions, 21 deletions
diff --git a/src/test/scala/uk/ac/ox/cs/rsacomb/SuiteAll.scala b/src/test/scala/uk/ac/ox/cs/rsacomb/SuiteAll.scala
index 2162f8c..f32c088 100644
--- a/src/test/scala/uk/ac/ox/cs/rsacomb/SuiteAll.scala
+++ b/src/test/scala/uk/ac/ox/cs/rsacomb/SuiteAll.scala
@@ -2,16 +2,25 @@ package uk.ac.ox.cs.rsacomb
2 2
3import org.scalatest.Suites 3import org.scalatest.Suites
4 4
5import uk.ac.ox.cs.rsacomb.converter.{OWLAxiomSpec, OWLClassSpec, RDFoxConverterSpec} 5import uk.ac.ox.cs.rsacomb.converter.{
6import uk.ac.ox.cs.rsacomb.sparql.{ConjunctiveQueryAnswerSpec, ConjunctiveQuerySpec} 6 OWLAxiomSpec,
7 OWLClassSpec,
8 RDFoxConverterSpec
9}
10import uk.ac.ox.cs.rsacomb.filtering.NaiveFilteringProgramSpec
11import uk.ac.ox.cs.rsacomb.sparql.{
12 ConjunctiveQueryAnswerSpec,
13 ConjunctiveQuerySpec
14}
7 15
8class SuiteAll extends Suites ( 16class SuiteAll
9 new Ontology1_CanonicalModelSpec, 17 extends Suites(
10 new Ontology2_CanonicalModelSpec, 18 new Ontology1_CanonicalModelSpec,
11 new FilteringProgramSpec, 19 new Ontology2_CanonicalModelSpec,
12 new OWLAxiomSpec, 20 new NaiveFilteringProgramSpec,
13 new OWLClassSpec, 21 new OWLAxiomSpec,
14 new RDFoxConverterSpec, 22 new OWLClassSpec,
15 new ConjunctiveQueryAnswerSpec, 23 new RDFoxConverterSpec,
16 new ConjunctiveQuerySpec 24 new ConjunctiveQueryAnswerSpec,
17) 25 new ConjunctiveQuerySpec
26 )
diff --git a/src/test/scala/uk/ac/ox/cs/rsacomb/FilteringProgramSpecs.scala b/src/test/scala/uk/ac/ox/cs/rsacomb/filtering/FilteringProgramSpecs.scala
index 32ef8da..372b78c 100644
--- a/src/test/scala/uk/ac/ox/cs/rsacomb/FilteringProgramSpecs.scala
+++ b/src/test/scala/uk/ac/ox/cs/rsacomb/filtering/FilteringProgramSpecs.scala
@@ -1,12 +1,14 @@
1package uk.ac.ox.cs.rsacomb 1package uk.ac.ox.cs.rsacomb.filtering
2 2
3import org.scalatest.flatspec.AnyFlatSpec 3import org.scalatest.flatspec.AnyFlatSpec
4import org.scalatest.matchers.should.Matchers 4import org.scalatest.matchers.should.Matchers
5import tech.oxfordsemantic.jrdfox.logic.expression.IRI 5import tech.oxfordsemantic.jrdfox.logic.expression.IRI
6import uk.ac.ox.cs.rsacomb.FilteringProgram 6import uk.ac.ox.cs.rsacomb.filtering.{FilteringProgram, FilterType}
7import uk.ac.ox.cs.rsacomb.sparql.ConjunctiveQuery 7import uk.ac.ox.cs.rsacomb.sparql.ConjunctiveQuery
8 8
9object FilteringProgramSpec { 9object NaiveFilteringProgramSpec {
10
11 val naive: FilterType = FilterType.FILTER_NAIVE
10 12
11 val constants = 13 val constants =
12 List(IRI.create("_:iri1"), IRI.create("_:iri2"), IRI.create("_:iri3")) 14 List(IRI.create("_:iri1"), IRI.create("_:iri2"), IRI.create("_:iri3"))
@@ -61,31 +63,31 @@ object FilteringProgramSpec {
61 """ 63 """
62} 64}
63 65
64class FilteringProgramSpec extends AnyFlatSpec with Matchers { 66class NaiveFilteringProgramSpec extends AnyFlatSpec with Matchers {
65 67
66 import FilteringProgramSpec._ 68 import NaiveFilteringProgramSpec._
67 69
68 "CQ 0" should "generate 27 rules and 3 facts" in { 70 "CQ 0" should "generate 27 rules and 3 facts" in {
69 val cq = ConjunctiveQuery.parse(cq0).get 71 val cq = ConjunctiveQuery.parse(cq0).get
70 val filter = FilteringProgram(cq) 72 val filter = FilteringProgram(naive)(cq)
71 filter.rules should have length 27 73 filter.rules should have length 27
72 } 74 }
73 75
74 "CQ 1" should "generate 15 rules" in { 76 "CQ 1" should "generate 15 rules" in {
75 val cq = ConjunctiveQuery.parse(cq1).get 77 val cq = ConjunctiveQuery.parse(cq1).get
76 val filter = FilteringProgram(cq) 78 val filter = FilteringProgram(naive)(cq)
77 filter.rules should have length 15 79 filter.rules should have length 15
78 } 80 }
79 81
80 "CQ 2" should "generate 51 rules" in { 82 "CQ 2" should "generate 51 rules" in {
81 val cq = ConjunctiveQuery.parse(cq2).get 83 val cq = ConjunctiveQuery.parse(cq2).get
82 val filter = FilteringProgram(cq) 84 val filter = FilteringProgram(naive)(cq)
83 filter.rules should have length 51 85 filter.rules should have length 51
84 } 86 }
85 87
86 "BCQ 0" should "generate 46 rules" in { 88 "BCQ 0" should "generate 46 rules" in {
87 val cq = ConjunctiveQuery.parse(bcq0).get 89 val cq = ConjunctiveQuery.parse(bcq0).get
88 val filter = FilteringProgram(cq) 90 val filter = FilteringProgram(naive)(cq)
89 filter.rules should have length 43 91 filter.rules should have length 43
90 } 92 }
91 93