diff options
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java')
| -rw-r--r-- | test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java | 276 |
1 files changed, 4 insertions, 272 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java index b97d85e..7d9b49c 100644 --- a/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java +++ b/test/uk/ac/ox/cs/pagoda/tester/PagodaTester.java | |||
| @@ -1,126 +1,18 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.tester; | 1 | package uk.ac.ox.cs.pagoda.tester; |
| 2 | 2 | ||
| 3 | import uk.ac.ox.cs.pagoda.query.AnswerTuple; | ||
| 4 | import uk.ac.ox.cs.pagoda.query.AnswerTuples; | ||
| 5 | import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; | 3 | import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; |
| 6 | import uk.ac.ox.cs.pagoda.util.Properties; | 4 | import uk.ac.ox.cs.pagoda.util.Properties; |
| 7 | import uk.ac.ox.cs.pagoda.util.Timer; | 5 | import uk.ac.ox.cs.pagoda.util.Timer; |
| 8 | import uk.ac.ox.cs.pagoda.util.Utility; | 6 | import uk.ac.ox.cs.pagoda.util.Utility; |
| 9 | 7 | ||
| 10 | import java.io.File; | 8 | // TODO clean it, or code another one |
| 11 | import java.io.FileNotFoundException; | ||
| 12 | import java.io.IOException; | ||
| 13 | import java.util.Scanner; | ||
| 14 | |||
| 15 | public class PagodaTester { | 9 | public class PagodaTester { |
| 16 | 10 | ||
| 17 | // public static final String onto_dir = "/media/RDFData/yzhou/"; | ||
| 18 | // public static final String onto_dir = "/users/yzhou/ontologies/"; | ||
| 19 | // public static final String onto_dir = "/home/scratch/yzhou/ontologies/"; | ||
| 20 | public static final String onto_dir = "/home/alessandro/Big_files/Ontologies/"; | ||
| 21 | |||
| 22 | public static final String fly = onto_dir + "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"; | ||
| 23 | public static final String fly_query = onto_dir + "fly/queries/fly.sparql"; | ||
| 24 | |||
| 25 | public static final String test_tbox = onto_dir + "smallExampleFromAna/dummy.owl"; | ||
| 26 | public static final String test_abox = onto_dir + "smallExampleFromAna/initialABox.ttl"; | ||
| 27 | public static final String test_query = onto_dir + "smallExampleFromAna/queries.dlog"; | ||
| 28 | |||
| 29 | public static final int lubm_number = 1; | ||
| 30 | public static final String lubm_tbox = onto_dir + "lubm/univ-bench.owl"; | ||
| 31 | public static final String lubm_abox = onto_dir + "lubm/data/lubm" + lubm_number + ".ttl"; | ||
| 32 | public static final String lubm_abox_copy = onto_dir + "lubm/data/lubm" + lubm_number + " (copy).ttl"; | ||
| 33 | public static final String lubm_query = onto_dir + "lubm/queries/test.sparql"; | ||
| 34 | public static final String lubm_query6 = onto_dir + "lubm/queries/test_q6.sparql"; | ||
| 35 | public static final String lubm_query20 = onto_dir + "lubm/queries/test_q16.sparql"; | ||
| 36 | |||
| 37 | public static final int uobm_number = 1; | ||
| 38 | public static final String uobm_tbox = onto_dir + "uobm/univ-bench-dl.owl"; | ||
| 39 | public static final String uobm_abox = onto_dir + "uobm/data/uobm" + uobm_number + ".ttl"; | ||
| 40 | public static final String uobm_query = onto_dir + "uobm/queries/test.sparql"; | ||
| 41 | public static final String uobm_query_temp = onto_dir + "uobm/queries/temp.sparql"; | ||
| 42 | public static final String uobm_query2 = onto_dir + "uobm/queries/standard_q2.sparql"; | ||
| 43 | public static final String uobm_query9 = onto_dir + "uobm/queries/standard_q9.sparql"; | ||
| 44 | public static final String uobm_query11 = onto_dir + "uobm/queries/standard_q11.sparql"; | ||
| 45 | public static final String uobm_query12 = onto_dir + "uobm/queries/standard_q12.sparql"; | ||
| 46 | public static final String uobm_query14 = onto_dir + "uobm/queries/standard_q14.sparql"; | ||
| 47 | public static final String uobm_query15 = onto_dir + "uobm/queries/standard_q15.sparql"; | ||
| 48 | public static final String uobm_query_multi = onto_dir + "uobm/queries/standard_multi.sparql"; | ||
| 49 | public static final String uobm_generated_query1 = onto_dir + "uobm/queries/generated_q1.sparql"; | ||
| 50 | public static final String uobm_query_group3 = onto_dir + "uobm/queries/standard_group3.sparql"; | ||
| 51 | |||
| 52 | public static final String npd_tbox = onto_dir + "npd/npd-all-minus-datatype.owl"; | ||
| 53 | // "npd/npd-all.owl"; | ||
| 54 | // "npd-all-minus-datatype.owl"; | ||
| 55 | public static final String npd_abox = onto_dir + "npd/data/npd-data-dump-minus-datatype-new.ttl"; | ||
| 56 | // "npd/data/npd-data-dump-processed.ttl"; | ||
| 57 | // "npd-data-dump-minus-datatype-old.ttl"; | ||
| 58 | public static final String npd_query = onto_dir + "npd/queries/atomic.sparql"; | ||
| 59 | |||
| 60 | public static final String npd_bench_tbox = onto_dir + "npd-benchmark/npd-v2-ql_a.owl"; // npd-all-minus-datatype.owl"; | ||
| 61 | public static final String npd_bench_abox = onto_dir + "npd-benchmark/npd-v2-ql_a.ttl"; // npd-data-dump-minus-datatype-old.ttl"; | ||
| 62 | public static final String npd_bench_query = onto_dir + "npd-benchmark/queries/all.sparql"; | ||
| 63 | |||
| 64 | public static final String dbpedia_tbox = onto_dir + "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"; | ||
| 65 | public static final String dbpedia_abox = onto_dir + "dbpedia/data/dbpedia-minus-datatype-new.ttl"; | ||
| 66 | public static final String dbpedia_query = onto_dir + "dbpedia/queries/atomic_ground.sparql"; | ||
| 67 | public static final String dbpedia_query274 = onto_dir + "dbpedia/atomic_q274.sparql"; | ||
| 68 | |||
| 69 | public static final String dbpedia_latest_tbox = onto_dir + "dbpedia/dbpedia_2014.owl"; | ||
| 70 | public static final String travel_tbox = onto_dir + "dbpedia/travel.owl"; | ||
| 71 | public static final String dbpedia_tbox_simple = onto_dir + "dbpedia/dbpedia_simple.owl"; | ||
| 72 | |||
| 73 | public static final String bioModels_tbox = onto_dir + "biomodels/biomodels-21.owl"; | ||
| 74 | public static final String bioModels_abox = onto_dir + "biomodels/data_processed_1.ttl"; | ||
| 75 | public static final String bioModels_queries = onto_dir + "biomodels/queries/queries.sparql"; | ||
| 76 | |||
| 77 | public static final String chembl_tbox = onto_dir + "bio2rdf/chembl/cco-processed-noDPR-noDPD.ttl"; | ||
| 78 | public static final String chembl_abox = onto_dir + "bio2rdf/chembl/graph sampling old/sample_100.nt"; | ||
| 79 | public static final String chembl_queries = onto_dir + "bio2rdf/chembl/queries/problematic.sparql"; //"bio2rdf/chembl/queries/atomic_one_filtered.sparql"; // | ||
| 80 | |||
| 81 | public static final String reactome_tbox = onto_dir + "bio2rdf/reactome/biopax-level3-processed.owl"; | ||
| 82 | public static final String reactome_abox = onto_dir + "bio2rdf/reactome/graph sampling old/sample.ttl"; //data/data.ttl"; //graph sampling old/reactome_sample_10.ttl"; // | ||
| 83 | public static final String reactome_queries = onto_dir +"bio2rdf/reactome/queries/atomic.sparql"; | ||
| 84 | |||
| 85 | public static final String uniprot_tbox = onto_dir + "bio2rdf/uniprot/core-processed.owl"; | ||
| 86 | public static final String uniprot_abox = onto_dir + "bio2rdf/uniprot/graph sampling/sample_1.nt"; | ||
| 87 | public static final String uniprot_queries = onto_dir + "bio2rdf/uniprot/queries/atomic_one.sparql"; | ||
| 88 | |||
| 89 | public static final String atlas_tbox = onto_dir + "bio2rdf/atlas/gxaterms.owl"; | ||
| 90 | public static final String atlas_abox = onto_dir + "bio2rdf/atlas/graph sampling/sample_1.nt"; | ||
| 91 | public static final String atlas_queries = onto_dir + "bio2rdf/atlas/queries/atomic_one.sparql"; | ||
| 92 | |||
| 93 | public static void main(String... args) { | 11 | public static void main(String... args) { |
| 94 | if (args.length == 0) { | 12 | // Properties properties = new Properties(PagodaTester.class. |
| 95 | // args = new String[] {test_tbox, test_abox, test_query}; | 13 | // getClassLoader().getResource("uobm.properties").getPath()); |
| 96 | // args = new String[] {lubm_tbox, lubm_abox, lubm_query}; | 14 | Properties properties = new Properties(); |
| 97 | // args = new String[] {uobm_tbox, uobm_abox, uobm_query}; | ||
| 98 | // args = new String[] {fly, "null", fly_query}; | ||
| 99 | // args = new String[] {dbpedia_tbox, dbpedia_abox, dbpedia_query}; | ||
| 100 | // args = new String[] {travel_tbox, null, dbpedia_query274}; | ||
| 101 | args = new String[] {fly, fly_query}; | ||
| 102 | // args = new String[] {npd_tbox, npd_abox, npd_query}; | ||
| 103 | // args = new String[] {npd_bench_tbox, npd_bench_abox, npd_bench_query}; | ||
| 104 | // args = new String[] {"../SemFacet/WebContent/WEB-INF/data/dbpedia.owl", "../SemFacet/WebContent/WEB-INF/data/dbpediaA.nt", null}; | ||
| 105 | // args = new String[] {"../core/WebContent/WEB-INF/data/fly.owl", "../core/WebContent/WEB-INF/data/fly-data.nt", null}; | ||
| 106 | // args = new String[] {"data/lubm/univ-bench.owl", "data/lubm/lubm1.ttl", "data/lubm/lubm.sparql", "lubm.ans"}; | ||
| 107 | // args = new String[] {"data/uobm/univ-bench-dl.owl", "data/uobm/uobm1.ttl", "data/uobm/uobm.sparql", "uobm.ans"}; | ||
| 108 | // args = new String[] {"data/fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", "data/fly/fly.sparql", "fly.ans"}; | ||
| 109 | // args = new String[] {bioModels_tbox, bioModels_abox, bioModels_queries}; | ||
| 110 | // args = new String[] {chembl_tbox, chembl_abox, chembl_queries}; | ||
| 111 | // args = new String[] {reactome_tbox, reactome_abox, reactome_queries}; | ||
| 112 | // args = new String[] {reactome_tbox, "/users/yzhou/temp/reactome_debug.ttl", onto_dir +"bio2rdf/reactome/queries/atomic_one_q65.sparql"}; | ||
| 113 | // args = new String[] {uniprot_tbox.replace(".owl", "-noDis.owl"), "/users/yzhou/temp/uniprot_debug/sample_1_string.nt", uniprot_queries}; | ||
| 114 | // args = new String[] {uniprot_tbox.replace(".owl", "-noDis.owl"), uniprot_abox, uniprot_queries}; | ||
| 115 | // args = new String[] {atlas_tbox, atlas_abox, atlas_queries}; | ||
| 116 | // args = new String[] {onto_dir + "test/unsatisfiable.owl", null, onto_dir + "test/unsatisfiable_queries.sparql"}; | ||
| 117 | // args = new String[] {onto_dir + "test/jair-example.owl", null, onto_dir + "test/jair-example_query.sparql"}; | ||
| 118 | // args[2] = args[2].replace(".sparql", "_all_pagoda.sparql"); | ||
| 119 | // args[2] = args[2].replace(".sparql", "_pellet.sparql"); | ||
| 120 | } | ||
| 121 | 15 | ||
| 122 | Properties properties = new Properties("config/uobm.properties"); | ||
| 123 | |||
| 124 | int index = 0; | 16 | int index = 0; |
| 125 | if (args.length > index) properties.setOntologyPath(args[index++]); | 17 | if (args.length > index) properties.setOntologyPath(args[index++]); |
| 126 | if (args.length > index && (args[index].endsWith(".ttl") || args[index].endsWith(".nt"))) properties.setDataPath(args[index++]); | 18 | if (args.length > index && (args[index].endsWith(".ttl") || args[index].endsWith(".nt"))) properties.setDataPath(args[index++]); |
| @@ -146,169 +38,9 @@ public class PagodaTester { | |||
| 146 | if (properties.getQueryPath() != null) | 38 | if (properties.getQueryPath() != null) |
| 147 | for (String queryFile: properties.getQueryPath().split(";")) | 39 | for (String queryFile: properties.getQueryPath().split(";")) |
| 148 | pagoda.evaluate(pagoda.getQueryManager().collectQueryRecords(queryFile)); | 40 | pagoda.evaluate(pagoda.getQueryManager().collectQueryRecords(queryFile)); |
| 149 | |||
| 150 | if (properties.getShellMode()) | ||
| 151 | try { | ||
| 152 | evaluateConsoleQuery(pagoda); | ||
| 153 | } catch (IOException e) { | ||
| 154 | e.printStackTrace(); | ||
| 155 | } | ||
| 156 | } finally { | 41 | } finally { |
| 157 | if (pagoda != null) pagoda.dispose(); | 42 | if (pagoda != null) pagoda.dispose(); |
| 158 | } | 43 | } |
| 159 | |||
| 160 | // Utility.closeCurrentOut(); | ||
| 161 | |||
| 162 | if (properties.getShellMode()) System.exit(0); | ||
| 163 | } | ||
| 164 | |||
| 165 | // private void printPredicatesWithGap() { | ||
| 166 | // for (String p: ((MyQueryReasoner) pagoda).getPredicatesWithGap()) { | ||
| 167 | // System.out.println(p); | ||
| 168 | // } | ||
| 169 | // } | ||
| 170 | |||
| 171 | private static void evaluateConsoleQuery(QueryReasoner pagoda) throws IOException { | ||
| 172 | int ending = (int) '$', symbol; | ||
| 173 | while (true) { | ||
| 174 | Utility.logInfo("Input your query ending with $"); | ||
| 175 | StringBuilder queryBuilder = new StringBuilder(); | ||
| 176 | while ((symbol = System.in.read()) != ending) { | ||
| 177 | queryBuilder.append((char) symbol); | ||
| 178 | } | ||
| 179 | System.in.read(); | ||
| 180 | if (queryBuilder.length() == 0) return ; | ||
| 181 | pagoda.evaluate_shell(queryBuilder.toString()); | ||
| 182 | } | ||
| 183 | } | ||
| 184 | |||
| 185 | void testReactomeQueries() { | ||
| 186 | evaluate("select ?x where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.biopax.org/release/biopax-level3.owl#DnaReference> . }"); | ||
| 187 | evaluate("select ?y ?z where { <http://identifiers.org/ensembl/ENSG00000157557> ?y ?z . }"); | ||
| 188 | evaluate("select ?y where { <http://identifiers.org/ensembl/ENSG00000157557> <http://www.biopax.org/release/biopax-level3.owl#name> ?y . }", true); | ||
| 189 | |||
| 190 | } | ||
| 191 | |||
| 192 | void testSemFacetQueries() { | ||
| 193 | // try { | ||
| 194 | // BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("query.line"))); | ||
| 195 | // for (String line; (line = reader.readLine()) != null && !line.isEmpty(); ) | ||
| 196 | // evaluate(line, true); | ||
| 197 | // reader.close(); | ||
| 198 | // } catch (FileNotFoundException e) { | ||
| 199 | // e.printStackTrace(); | ||
| 200 | // } catch (IOException e) { | ||
| 201 | // e.printStackTrace(); | ||
| 202 | // } | ||
| 203 | evaluate("select ?x ?z where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z }", true); | ||
| 204 | evaluate("select distinct ?y where { ?x ?y ?z }", true); | ||
| 205 | evaluate("select distinct ?z where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z }", true); | ||
| 206 | evaluate("select ?y ?z where { <http://www.reactome.org/biopax/46/49633#Protein3885> ?y ?z .}", true); | ||
| 207 | } | ||
| 208 | |||
| 209 | void testISGQueries() { | ||
| 210 | evaluate("select ?z where {<http://cs.ox.ac.uk/Evgeny_Kharlamov> <http://cs.ox.ac.uk/lat> ?z .}", false); | ||
| 211 | evaluate("select ?x where {?x <http://cs.ox.ac.uk/type> <http://cs.ox.ac.uk/person> .}", false); | ||
| 212 | } | ||
| 213 | |||
| 214 | void testSomeTravelQueries() { | ||
| 215 | evaluate("select ?y ?z where {<http://www.owl-ontologies.com/travel.owl#BlueMountains> ?y ?z. }", true); | ||
| 216 | evaluate("select ?x where {?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.owl-ontologies.com/travel.owl#RetireeDestination>. }"); | ||
| 217 | evaluate("select ?x where {?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.owl-ontologies.com/travel.owl#BackpackersDestination>. }"); | ||
| 218 | } | ||
| 219 | |||
| 220 | void testSomeFlyQueries() { | ||
| 221 | evaluate("select ?x where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00005106> . }", false); | ||
| 222 | |||
| 223 | evaluate("select DISTINCT ?z where { ?x <http://purl.obolibrary.org/obo/FBbt#develops_from> ?any . ?any <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z . ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00067123> . } ", true); | ||
| 224 | |||
| 225 | evaluate("Select ?x where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> " | ||
| 226 | + "<http://purl.obolibrary.org/obo/FBbt_00067123>. ?x " | ||
| 227 | + "<http://purl.obolibrary.org/obo/RO_0002131> ?any . ?any " | ||
| 228 | + "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> " | ||
| 229 | + "<http://purl.obolibrary.org/obo/FBbt_00005140> . }", true); | ||
| 230 | |||
| 231 | evaluate("Select ?x where {?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> " | ||
| 232 | + "<http://purl.obolibrary.org/obo/FBbt_00067363> . ?x " | ||
| 233 | + "<http://purl.obolibrary.org/obo/RO_0002131> ?any . ?any " | ||
| 234 | + "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> " | ||
| 235 | + "<http://purl.obolibrary.org/obo/FBbt_00005140> . }", true); | ||
| 236 | |||
| 237 | // evaluate("Select ?x where { " | ||
| 238 | // + "?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00003660>. " | ||
| 239 | // + "?x <http://purl.obolibrary.org/obo/FBbt#develops_from> ?any . " | ||
| 240 | // + "?any <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00001446> . }", true); | ||
| 241 | |||
| 242 | evaluate("select DISTINCT ?z where { ?x <http://purl.obolibrary.org/obo/RO_0002110> ?any . " | ||
| 243 | + "?any <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z . " | ||
| 244 | + "?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00007016> . } ", true); | ||
| 245 | |||
| 246 | evaluate("Select * where {" | ||
| 247 | + "<http://www.virtualflybrain.org/ontologies/individuals/VFB_00100607> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00007364>. " | ||
| 248 | + "<http://www.virtualflybrain.org/ontologies/individuals/VFB_00100607> <http://www.w3.org/2002/07/owl#sameAs> ?z }", true); | ||
| 249 | |||
| 250 | evaluate("SELECT DISTINCT ?x ?z WHERE {?x <http://www.w3.org/2002/07/owl#sameAs> ?z}", true); | ||
| 251 | evaluate("SELECT DISTINCT ?x ?z WHERE {?x <http://purl.obolibrary.org/obo/BFO_0000051> ?z}", true); | ||
| 252 | |||
| 253 | evaluate("select DISTINCT ?y where { ?x ?y ?z . " | ||
| 254 | + "?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.obolibrary.org/obo/FBbt_00007364> }", true); | ||
| 255 | |||
| 256 | evaluateQueriesFromFile("/users/yzhou/Downloads/logs(1).log"); | ||
| 257 | evaluateQueriesFromFile("/users/yzhou/Downloads/logs.log"); | ||
| 258 | |||
| 259 | evaluate("SELECT DISTINCT ?x ?z WHERE {?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z}", true); | ||
| 260 | evaluate("SELECT DISTINCT ?x ?z WHERE {?x <http://xmlns.com/foaf/0.1/depicts> ?z}", true); | ||
| 261 | |||
| 262 | evaluate("select ?x ?z where { ?x <http://www.w3.org/2002/07/owl#sameAs> ?z } ", true); | ||
| 263 | evaluate("select ?x ?z where { ?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?z } ", true); | ||
| 264 | } | ||
| 265 | |||
| 266 | public void evaluateQueriesFromFile(String fileName) { | ||
| 267 | Scanner scanner = null; | ||
| 268 | try { | ||
| 269 | scanner = new Scanner(new File(fileName)); | ||
| 270 | String line; | ||
| 271 | while (scanner.hasNextLine()) { | ||
| 272 | line = scanner.nextLine(); | ||
| 273 | if (line.startsWith("select")) | ||
| 274 | evaluate(line, true); | ||
| 275 | } | ||
| 276 | } catch (FileNotFoundException e) { | ||
| 277 | e.printStackTrace(); | ||
| 278 | } finally { | ||
| 279 | if (scanner != null) | ||
| 280 | scanner.close(); | ||
| 281 | } | ||
| 282 | } | ||
| 283 | |||
| 284 | QueryReasoner pagoda; | ||
| 285 | |||
| 286 | public PagodaTester(QueryReasoner reasoner) { | ||
| 287 | pagoda = reasoner; | ||
| 288 | } | ||
| 289 | |||
| 290 | Timer timer = new Timer(); | ||
| 291 | |||
| 292 | private void evaluate(String query) { | ||
| 293 | evaluate(query, false); | ||
| 294 | } | ||
| 295 | |||
| 296 | private void evaluate(String query, boolean tag) { | ||
| 297 | timer.reset(); | ||
| 298 | AnswerTuples tuples = pagoda.evaluate(query, tag); | ||
| 299 | int arity = tuples.getArity(); | ||
| 300 | int count = 0; | ||
| 301 | for (AnswerTuple tuple; tuples.isValid(); tuples.moveNext()) { | ||
| 302 | tuple = tuples.getTuple(); | ||
| 303 | for (int i = 0; i < arity; ++i) | ||
| 304 | tuple.getGroundTerm(i).toString(); | ||
| 305 | // System.out.print(tuple.getGroundTerm(i).toString() + "\t"); | ||
| 306 | // System.out.println(); | ||
| 307 | ++count; | ||
| 308 | } | ||
| 309 | tuples.dispose(); | ||
| 310 | Utility.logInfo("The number of answers for this SemFacet query: " + count); | ||
| 311 | Utility.logInfo("Total time for this SemFacet query: " + timer.duration()); | ||
| 312 | } | 44 | } |
| 313 | 45 | ||
| 314 | } | 46 | } |
