diff options
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/global_tests')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswers.java (renamed from test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java) | 23 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java | 48 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java | 52 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java | 5 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java | 35 | ||||
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java | 45 |
6 files changed, 109 insertions, 99 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java b/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswers.java index 424afa2..14050ce 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswersOverDataset.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/CheckAnswers.java | |||
| @@ -3,37 +3,24 @@ package uk.ac.ox.cs.pagoda.global_tests; | |||
| 3 | import com.google.gson.Gson; | 3 | import com.google.gson.Gson; |
| 4 | import com.google.gson.reflect.TypeToken; | 4 | import com.google.gson.reflect.TypeToken; |
| 5 | import org.testng.Assert; | 5 | import org.testng.Assert; |
| 6 | import uk.ac.ox.cs.pagoda.Pagoda; | ||
| 7 | import uk.ac.ox.cs.pagoda.query.QueryRecord; | 6 | import uk.ac.ox.cs.pagoda.query.QueryRecord; |
| 8 | 7 | ||
| 9 | import java.io.BufferedReader; | 8 | import java.io.BufferedReader; |
| 10 | import java.io.File; | ||
| 11 | import java.io.IOException; | 9 | import java.io.IOException; |
| 12 | import java.lang.reflect.Type; | 10 | import java.lang.reflect.Type; |
| 13 | import java.nio.file.Files; | 11 | import java.nio.file.Files; |
| 14 | import java.nio.file.Path; | 12 | import java.nio.file.Path; |
| 15 | import java.nio.file.Paths; | ||
| 16 | import java.util.Set; | 13 | import java.util.Set; |
| 17 | 14 | ||
| 18 | /** | 15 | /** |
| 19 | * Given an instance of Pagoda, it checks the returned answers. | 16 | * It provides auxiliary methods for checking answers. |
| 20 | * */ | 17 | * */ |
| 21 | public class CheckAnswersOverDataset { | 18 | public class CheckAnswers { |
| 22 | 19 | ||
| 23 | public static void check(Pagoda pagoda, Path givenAnswers) { | 20 | private CheckAnswers() { |
| 24 | try { | ||
| 25 | // Utility.setLogLevel(Level.DEBUG); // uncomment for outputting partial results | ||
| 26 | Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 27 | new File(computedAnswers.toString()).deleteOnExit(); | ||
| 28 | |||
| 29 | pagoda.run(); | ||
| 30 | assertSameContent(computedAnswers, givenAnswers); | ||
| 31 | } catch (IOException e) { | ||
| 32 | e.printStackTrace(); | ||
| 33 | } | ||
| 34 | } | 21 | } |
| 35 | 22 | ||
| 36 | private static void assertSameContent(Path computedAnswersFile, Path givenAnswersFile) throws IOException { | 23 | public static void assertSameAnswers(Path computedAnswersFile, Path givenAnswersFile) throws IOException { |
| 37 | BufferedReader computedReader = Files.newBufferedReader(computedAnswersFile); | 24 | BufferedReader computedReader = Files.newBufferedReader(computedAnswersFile); |
| 38 | BufferedReader givenReader = Files.newBufferedReader(givenAnswersFile); | 25 | BufferedReader givenReader = Files.newBufferedReader(givenAnswersFile); |
| 39 | 26 | ||
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java index 0d77fdb..18f6cf9 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java | |||
| @@ -8,16 +8,24 @@ import java.io.IOException; | |||
| 8 | 8 | ||
| 9 | public class JAIR_PAGOdA { | 9 | public class JAIR_PAGOdA { |
| 10 | 10 | ||
| 11 | public static void main(String... args) { | ||
| 12 | try { | ||
| 13 | new JAIR_PAGOdA().lubm1(); | ||
| 14 | } catch(IOException e) { | ||
| 15 | e.printStackTrace(); | ||
| 16 | } | ||
| 17 | } | ||
| 18 | |||
| 11 | @Test | 19 | @Test |
| 12 | public void lubm1() throws IOException { | 20 | public void lubm1() throws IOException { |
| 13 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 21 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 14 | String[] args = new String[] { | 22 | String[] args = new String[] { |
| 15 | TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), | 23 | TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), |
| 16 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), | 24 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), |
| 17 | TestUtil.combinePaths(ontoDir, "lubm/queries/test.sparql") | 25 | TestUtil.combinePaths(ontoDir, "lubm/queries/answersCorrectness.sparql") |
| 18 | }; | 26 | }; |
| 19 | PagodaTester.main(args); | 27 | PagodaTester.main(args); |
| 20 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda"); | 28 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda"); |
| 21 | } | 29 | } |
| 22 | 30 | ||
| 23 | @Test | 31 | @Test |
| @@ -29,7 +37,7 @@ public class JAIR_PAGOdA { | |||
| 29 | TestUtil.combinePaths(ontoDir, "lubm/queries/test_pellet.sparql") | 37 | TestUtil.combinePaths(ontoDir, "lubm/queries/test_pellet.sparql") |
| 30 | }; | 38 | }; |
| 31 | PagodaTester.main(args); | 39 | PagodaTester.main(args); |
| 32 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_conj"); | 40 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda_conj"); |
| 33 | } | 41 | } |
| 34 | 42 | ||
| 35 | @Test | 43 | @Test |
| @@ -40,7 +48,7 @@ public class JAIR_PAGOdA { | |||
| 40 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), | 48 | TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), |
| 41 | TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql") | 49 | TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql") |
| 42 | ); | 50 | ); |
| 43 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/lubm1/pagoda_rolledUp"); | 51 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda_rolledUp"); |
| 44 | } | 52 | } |
| 45 | 53 | ||
| 46 | @Test | 54 | @Test |
| @@ -52,7 +60,7 @@ public class JAIR_PAGOdA { | |||
| 52 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql") | 60 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql") |
| 53 | }; | 61 | }; |
| 54 | PagodaTester.main(args); | 62 | PagodaTester.main(args); |
| 55 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda"); | 63 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda"); |
| 56 | } | 64 | } |
| 57 | 65 | ||
| 58 | @Test | 66 | @Test |
| @@ -64,7 +72,7 @@ public class JAIR_PAGOdA { | |||
| 64 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard_pellet.sparql") | 72 | TestUtil.combinePaths(ontoDir, "uobm/queries/standard_pellet.sparql") |
| 65 | }; | 73 | }; |
| 66 | PagodaTester.main(args); | 74 | PagodaTester.main(args); |
| 67 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_conj"); | 75 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda_conj"); |
| 68 | } | 76 | } |
| 69 | 77 | ||
| 70 | @Test | 78 | @Test |
| @@ -76,7 +84,7 @@ public class JAIR_PAGOdA { | |||
| 76 | TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql") | 84 | TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql") |
| 77 | }; | 85 | }; |
| 78 | PagodaTester.main(args); | 86 | PagodaTester.main(args); |
| 79 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uobm1/pagoda_rolledUp"); | 87 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda_rolledUp"); |
| 80 | } | 88 | } |
| 81 | 89 | ||
| 82 | @Test | 90 | @Test |
| @@ -88,7 +96,7 @@ public class JAIR_PAGOdA { | |||
| 88 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") | 96 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") |
| 89 | }; | 97 | }; |
| 90 | PagodaTester.main(args); | 98 | PagodaTester.main(args); |
| 91 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda"); | 99 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda"); |
| 92 | } | 100 | } |
| 93 | 101 | ||
| 94 | @Test | 102 | @Test |
| @@ -100,10 +108,9 @@ public class JAIR_PAGOdA { | |||
| 100 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") | 108 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") |
| 101 | }; | 109 | }; |
| 102 | PagodaTester.main(args); | 110 | PagodaTester.main(args); |
| 103 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_conj"); | 111 | TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda_conj"); |
| 104 | } | 112 | } |
| 105 | 113 | ||
| 106 | |||
| 107 | public void fly_rolledUp() { | 114 | public void fly_rolledUp() { |
| 108 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 115 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 109 | PagodaTester.main( | 116 | PagodaTester.main( |
| @@ -112,7 +119,7 @@ public class JAIR_PAGOdA { | |||
| 112 | null, | 119 | null, |
| 113 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql") | 120 | TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql") |
| 114 | ); | 121 | ); |
| 115 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/fly/pagoda_rolledUp"); | 122 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda_rolledUp"); |
| 116 | } | 123 | } |
| 117 | 124 | ||
| 118 | public void dbpedia() { | 125 | public void dbpedia() { |
| @@ -124,7 +131,7 @@ public class JAIR_PAGOdA { | |||
| 124 | "dbpedia.ans" | 131 | "dbpedia.ans" |
| 125 | ); | 132 | ); |
| 126 | 133 | ||
| 127 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/dbpedia/pagoda"); | 134 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/dbpedia/pagoda"); |
| 128 | } | 135 | } |
| 129 | 136 | ||
| 130 | public void npd() { | 137 | public void npd() { |
| @@ -136,7 +143,7 @@ public class JAIR_PAGOdA { | |||
| 136 | , "npd.ans" | 143 | , "npd.ans" |
| 137 | ); | 144 | ); |
| 138 | 145 | ||
| 139 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/npd/pagoda"); | 146 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/npd/pagoda"); |
| 140 | } | 147 | } |
| 141 | 148 | ||
| 142 | public void reactome() throws IOException { | 149 | public void reactome() throws IOException { |
| @@ -151,7 +158,7 @@ public class JAIR_PAGOdA { | |||
| 151 | ); | 158 | ); |
| 152 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_reactome.example"); | 159 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_reactome.example"); |
| 153 | 160 | ||
| 154 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_10p"); | 161 | // TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/pagoda_10p"); |
| 155 | } | 162 | } |
| 156 | 163 | ||
| 157 | public void chembl() throws IOException { | 164 | public void chembl() throws IOException { |
| @@ -164,7 +171,7 @@ public class JAIR_PAGOdA { | |||
| 164 | , "pagoda_chembl.ans" | 171 | , "pagoda_chembl.ans" |
| 165 | ); | 172 | ); |
| 166 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_chembl.example"); | 173 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_chembl.example"); |
| 167 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_1p"); | 174 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/pagoda_1p"); |
| 168 | } | 175 | } |
| 169 | 176 | ||
| 170 | public void uniprot() throws IOException { | 177 | public void uniprot() throws IOException { |
| @@ -178,16 +185,7 @@ public class JAIR_PAGOdA { | |||
| 178 | , "pagoda_uniprot.ans" | 185 | , "pagoda_uniprot.ans" |
| 179 | ); | 186 | ); |
| 180 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_uniprot.example"); | 187 | TestUtil.copyFile("log4j.log", "output/jair/pagoda_uniprot.example"); |
| 181 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_1p"); | 188 | // TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/pagoda_1p"); |
| 182 | } | ||
| 183 | |||
| 184 | |||
| 185 | public static void main(String... args) { | ||
| 186 | try { | ||
| 187 | new JAIR_PAGOdA().lubm1(); | ||
| 188 | } catch (IOException e) { | ||
| 189 | e.printStackTrace(); | ||
| 190 | } | ||
| 191 | } | 189 | } |
| 192 | 190 | ||
| 193 | } | 191 | } |
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java index 687ffee..5feda35 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java | |||
| @@ -9,13 +9,18 @@ import java.io.IOException; | |||
| 9 | 9 | ||
| 10 | public class JAIR_Scalability { | 10 | public class JAIR_Scalability { |
| 11 | 11 | ||
| 12 | private static final String date = "_0123"; | 12 | private static final String date = "_0123"; |
| 13 | 13 | ||
| 14 | public static void main(String... args) throws IOException { | ||
| 15 | Properties.shellModeDefault = true; | ||
| 16 | new JAIR_Scalability().testUniProt(50, false); | ||
| 17 | } | ||
| 18 | |||
| 14 | @Test | 19 | @Test |
| 15 | public void reactome() throws IOException { | 20 | public void reactome() throws IOException { |
| 16 | testReactome(10, false); | 21 | testReactome(10, false); |
| 17 | } | 22 | } |
| 18 | 23 | ||
| 19 | @Test | 24 | @Test |
| 20 | public void chembl() throws IOException { | 25 | public void chembl() throws IOException { |
| 21 | testChEMBL(1, false); | 26 | testChEMBL(1, false); |
| @@ -31,15 +36,15 @@ public class JAIR_Scalability { | |||
| 31 | String[] args = new String[] { | 36 | String[] args = new String[] { |
| 32 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"), | 37 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"), |
| 33 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl"), | 38 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl"), |
| 34 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/test.sparql") | 39 | TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/answersCorrectness.sparql") |
| 35 | , "reactome.ans" | 40 | , "reactome.ans" |
| 36 | }; | 41 | }; |
| 37 | if (percentage == 10) | 42 | if (percentage == 10) |
| 38 | args[1] = args[1].replace("simplifed", "reactome"); | 43 | args[1] = args[1].replace("simplifed", "reactome"); |
| 39 | 44 | ||
| 40 | PagodaTester.main(args); | 45 | PagodaTester.main(args); |
| 41 | if (save) | 46 | if (save) |
| 42 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/reactome/pagoda_" + percentage + "p" + date); | 47 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/pagoda_" + percentage + "p" + date); |
| 43 | } | 48 | } |
| 44 | 49 | ||
| 45 | public void testChEMBL(int percentage, boolean save) throws IOException { | 50 | public void testChEMBL(int percentage, boolean save) throws IOException { |
| @@ -48,18 +53,18 @@ public class JAIR_Scalability { | |||
| 48 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"), | 53 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"), |
| 49 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/sample_" + percentage + ".nt"), | 54 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/sample_" + percentage + ".nt"), |
| 50 | // TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql") | 55 | // TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql") |
| 51 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/test.sparql") | 56 | TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/answersCorrectness.sparql") |
| 52 | , "chembl.ans" | 57 | , "chembl.ans" |
| 53 | }; | 58 | }; |
| 54 | if (percentage == 1 || percentage == 10 || percentage == 50) | 59 | if (percentage == 1 || percentage == 10 || percentage == 50) |
| 55 | args[1] = args[1].replace("chembl", "chembl/graph sampling"); | 60 | args[1] = args[1].replace("chembl", "chembl/graph sampling"); |
| 56 | else | 61 | else |
| 57 | if (percentage == 100) | 62 | if (percentage == 100) |
| 58 | args[1] = "/home/yzhou/RDFData/ChEMBL/facts/ChEMBL.ttl"; | 63 | args[1] = "/home/yzhou/RDFData/ChEMBL/facts/ChEMBL.ttl"; |
| 59 | 64 | ||
| 60 | PagodaTester.main(args); | 65 | PagodaTester.main(args); |
| 61 | if (save) | 66 | if (save) |
| 62 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/chembl/pagoda_" + percentage + "p" + date); | 67 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/pagoda_" + percentage + "p" + date); |
| 63 | } | 68 | } |
| 64 | 69 | ||
| 65 | public void testUniProt(int percentage, boolean save) throws IOException { | 70 | public void testUniProt(int percentage, boolean save) throws IOException { |
| @@ -68,24 +73,19 @@ public class JAIR_Scalability { | |||
| 68 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"), | 73 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"), |
| 69 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/sample_" + percentage + ".nt"), | 74 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/sample_" + percentage + ".nt"), |
| 70 | // TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql") | 75 | // TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql") |
| 71 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/test.sparql") | 76 | TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/answersCorrectness.sparql") |
| 72 | , "uniprot.ans" | 77 | , "uniprot.ans" |
| 73 | }; | 78 | }; |
| 74 | 79 | ||
| 75 | if (percentage == 1 || percentage == 10 || percentage == 50) | 80 | if (percentage == 1 || percentage == 10 || percentage == 50) |
| 76 | args[1] = args[1].replace("uniprot", "uniprot/graph sampling"); | 81 | args[1] = args[1].replace("uniprot", "uniprot/graph sampling"); |
| 77 | else | 82 | else |
| 78 | if (percentage == 100) | 83 | if (percentage == 100) |
| 79 | args[1] = "/home/yzhou/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/data/uniprot_cleaned.nt"; | 84 | args[1] = "/home/yzhou/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/data/uniprot_cleaned.nt"; |
| 80 | 85 | ||
| 81 | PagodaTester.main(args); | 86 | PagodaTester.main(args); |
| 82 | if (save) | 87 | if (save) |
| 83 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/test-share/results_new/uniprot/pagoda_" + percentage + "p" + date); | 88 | TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/pagoda_" + percentage + "p" + date); |
| 84 | } | ||
| 85 | |||
| 86 | public static void main(String... args) throws IOException { | ||
| 87 | Properties.shellModeDefault = true; | ||
| 88 | new JAIR_Scalability().testUniProt(50, false); | ||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | } | 91 | } |
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java index b073a26..7fc5da8 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java | |||
| @@ -4,12 +4,13 @@ import org.testng.annotations.Test; | |||
| 4 | 4 | ||
| 5 | import java.io.IOException; | 5 | import java.io.IOException; |
| 6 | 6 | ||
| 7 | @Deprecated | ||
| 7 | public class LightEvaluation { | 8 | public class LightEvaluation { |
| 8 | 9 | ||
| 9 | @Test | 10 | @Test |
| 10 | public void evaluation() throws IOException { | 11 | public void evaluation() throws IOException { |
| 11 | new TestPagodaUOBM().test(1); | 12 | new TestPagodaUOBM().answersCorrectness(1); |
| 12 | new TestPagodaLUBM().test(100); | 13 | new TestPagodaLUBM().answersCorrecntess(100); |
| 13 | new TestPagodaFLY().test(); | 14 | new TestPagodaFLY().test(); |
| 14 | new TestPagodaDBPedia().test(); | 15 | new TestPagodaDBPedia().test(); |
| 15 | new TestPagodaNPD().testNPDwithoutDataType(); | 16 | new TestPagodaNPD().testNPDwithoutDataType(); |
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java index bb58681..8cbe022 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java | |||
| @@ -4,42 +4,57 @@ import org.testng.annotations.Test; | |||
| 4 | import uk.ac.ox.cs.pagoda.Pagoda; | 4 | import uk.ac.ox.cs.pagoda.Pagoda; |
| 5 | import uk.ac.ox.cs.pagoda.util.TestUtil; | 5 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 6 | 6 | ||
| 7 | import java.io.File; | ||
| 7 | import java.io.IOException; | 8 | import java.io.IOException; |
| 9 | import java.nio.file.Path; | ||
| 8 | import java.nio.file.Paths; | 10 | import java.nio.file.Paths; |
| 9 | 11 | ||
| 10 | public class TestPagodaLUBM { | 12 | public class TestPagodaLUBM { |
| 11 | 13 | ||
| 12 | public void test(int number) throws IOException { | 14 | /** |
| 15 | * Just execute on LUBM 100 | ||
| 16 | */ | ||
| 17 | public static void main(String... args) { | ||
| 18 | new TestPagodaLUBM().justExecute_100(); | ||
| 19 | } | ||
| 20 | |||
| 21 | public void answersCorrecntess(int number) throws IOException { | ||
| 13 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 22 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 23 | Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 24 | new File(computedAnswers.toString()).deleteOnExit(); | ||
| 25 | |||
| 14 | Pagoda pagoda = Pagoda.builder() | 26 | Pagoda pagoda = Pagoda.builder() |
| 15 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) | 27 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) |
| 16 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) | 28 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) |
| 17 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) | 29 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) |
| 30 | .answer(computedAnswers) | ||
| 18 | .classify(true) | 31 | .classify(true) |
| 19 | .hermit(true) | 32 | .hermit(true) |
| 20 | .build(); | 33 | .build(); |
| 21 | CheckAnswersOverDataset.check(pagoda, Paths.get(ontoDir, "lubm/lubm" + number + ".json")); | 34 | pagoda.run(); |
| 35 | |||
| 36 | Path givenAnswers = Paths.get(ontoDir, "lubm/lubm" + number + ".json"); | ||
| 37 | CheckAnswers.assertSameAnswers(computedAnswers, givenAnswers); | ||
| 22 | } | 38 | } |
| 23 | 39 | ||
| 24 | @Test | 40 | @Test(groups = {"light"}) |
| 25 | public void test_1() throws IOException { | 41 | public void answersCorrectness_1() throws IOException { |
| 26 | test(1); | 42 | answersCorrecntess(1); |
| 27 | } | 43 | } |
| 28 | 44 | ||
| 45 | /** | ||
| 46 | * Just execute on LUBM 100 | ||
| 47 | * */ | ||
| 29 | public void justExecute_100() { | 48 | public void justExecute_100() { |
| 30 | int number = 100; | 49 | int number = 100; |
| 31 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 50 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 32 | Pagoda pagoda = Pagoda.builder() | 51 | Pagoda pagoda = Pagoda.builder() |
| 33 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) | 52 | .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) |
| 34 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) | 53 | .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) |
| 35 | .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) | 54 | .query(Paths.get(ontoDir, "lubm/queries/answersCorrectness.sparql")) |
| 36 | .classify(true) | 55 | .classify(true) |
| 37 | .hermit(true) | 56 | .hermit(true) |
| 38 | .build(); | 57 | .build(); |
| 39 | pagoda.run(); | 58 | pagoda.run(); |
| 40 | } | 59 | } |
| 41 | |||
| 42 | public static void main(String... args) { | ||
| 43 | new TestPagodaLUBM().justExecute_100(); | ||
| 44 | } | ||
| 45 | } | 60 | } |
diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java index 61235d3..23d79ab 100644 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java +++ b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java | |||
| @@ -6,48 +6,57 @@ import uk.ac.ox.cs.pagoda.Pagoda; | |||
| 6 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; | 6 | import uk.ac.ox.cs.pagoda.tester.PagodaTester; |
| 7 | import uk.ac.ox.cs.pagoda.util.TestUtil; | 7 | import uk.ac.ox.cs.pagoda.util.TestUtil; |
| 8 | 8 | ||
| 9 | import java.io.File; | ||
| 9 | import java.io.IOException; | 10 | import java.io.IOException; |
| 11 | import java.nio.file.Path; | ||
| 10 | import java.nio.file.Paths; | 12 | import java.nio.file.Paths; |
| 11 | 13 | ||
| 12 | import static uk.ac.ox.cs.pagoda.util.TestUtil.combinePaths; | 14 | import static uk.ac.ox.cs.pagoda.util.TestUtil.combinePaths; |
| 13 | 15 | ||
| 14 | public class TestPagodaUOBM { | 16 | public class TestPagodaUOBM { |
| 15 | 17 | ||
| 16 | public void test(int number) throws IOException { | 18 | |
| 19 | private static final int N_1 = 1; | ||
| 20 | private static final int N_2 = 10; | ||
| 21 | |||
| 22 | @DataProvider(name = "uobmNumbers") | ||
| 23 | public static Object[][] uobmNumbers() { | ||
| 24 | Integer[][] integers = new Integer[N_2 - N_1 + 1][1]; | ||
| 25 | for(int i = 0; i < N_2 - N_1 + 1; i++) | ||
| 26 | integers[i][0] = N_1 + i; | ||
| 27 | return integers; | ||
| 28 | } | ||
| 29 | |||
| 30 | public void answersCorrectness(int number) throws IOException { | ||
| 17 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 31 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 32 | Path computedAnswers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); | ||
| 33 | new File(computedAnswers.toString()).deleteOnExit(); | ||
| 34 | |||
| 18 | Pagoda pagoda = Pagoda.builder() | 35 | Pagoda pagoda = Pagoda.builder() |
| 19 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) | 36 | .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) |
| 20 | .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) | 37 | .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) |
| 21 | .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) | 38 | .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) |
| 39 | .answer(computedAnswers) | ||
| 22 | .classify(true) | 40 | .classify(true) |
| 23 | .hermit(true) | 41 | .hermit(true) |
| 24 | .build(); | 42 | .build(); |
| 25 | CheckAnswersOverDataset.check(pagoda, | 43 | pagoda.run(); |
| 26 | Paths.get(ontoDir, "uobm/uobm" + number + ".json")); | ||
| 27 | } | ||
| 28 | 44 | ||
| 29 | @Test | 45 | String given_answers = "uobm/uobm" + number + ".json"; |
| 30 | public void test_1() throws IOException { | 46 | CheckAnswers.assertSameAnswers(computedAnswers, Paths.get(ontoDir, given_answers)); |
| 31 | test(1); | ||
| 32 | } | 47 | } |
| 33 | 48 | ||
| 34 | private static final int N_1 = 1; | 49 | @Test(groups = {"light"}) |
| 35 | private static final int N_2 = 10; | 50 | public void answersCorrectness_1() throws IOException { |
| 36 | 51 | answersCorrectness(1); | |
| 37 | @DataProvider(name = "uobmNumbers") | ||
| 38 | public static Object[][] uobmNumbers() { | ||
| 39 | Integer[][] integers = new Integer[N_2 - N_1 + 1][1]; | ||
| 40 | for (int i = 0; i < N_2 - N_1 + 1; i++) | ||
| 41 | integers[i][0]= N_1 + i; | ||
| 42 | return integers; | ||
| 43 | } | 52 | } |
| 44 | 53 | ||
| 45 | @Test(dataProvider = "uobmNumbers") | 54 | @Test(groups = {"heavy"}, dataProvider = "uobmNumbers") |
| 46 | public void justExecute(int number) { | 55 | public void justExecute(int number) { |
| 47 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); | 56 | String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); |
| 48 | PagodaTester.main(combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), | 57 | PagodaTester.main(combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), |
| 49 | combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), | 58 | combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), |
| 50 | combinePaths(ontoDir, "uobm/queries/test.sparql")); | 59 | combinePaths(ontoDir, "uobm/queries/answersCorrectness.sparql")); |
| 51 | } | 60 | } |
| 52 | 61 | ||
| 53 | } | 62 | } |
