From 17bd9beaf7f358a44e5bf36a5855fe6727d506dc Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Tue, 10 May 2022 18:17:06 +0100 Subject: [pagoda] Move project to Scala This commit includes a few changes: - The repository still uses Maven to manage dependency but it is now a Scala project. - The code has been ported from OWLAPI 3.4.10 to 5.1.20 - A proof of concept program using both RSAComb and PAGOdA has been added. --- test/uk/ac/ox/cs/pagoda/global_tests/BugTests.java | 240 ------------------ .../ox/cs/pagoda/global_tests/CostEvaluation.java | 115 --------- .../ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java | 191 --------------- .../cs/pagoda/global_tests/JAIR_Scalability.java | 91 ------- .../ox/cs/pagoda/global_tests/LightEvaluation.java | 18 -- .../ac/ox/cs/pagoda/global_tests/MadeUpCases.java | 77 ------ .../cs/pagoda/global_tests/SkolemisationTests.java | 269 --------------------- .../pagoda/global_tests/TestGapMappedToLower.java | 68 ------ .../cs/pagoda/global_tests/TestPagodaDBPedia.java | 33 --- .../ox/cs/pagoda/global_tests/TestPagodaFLY.java | 107 -------- .../ox/cs/pagoda/global_tests/TestPagodaLUBM.java | 92 ------- .../ox/cs/pagoda/global_tests/TestPagodaNPD.java | 38 --- .../cs/pagoda/global_tests/TestPagodaReactome.java | 53 ---- .../ox/cs/pagoda/global_tests/TestPagodaUOBM.java | 122 ---------- 14 files changed, 1514 deletions(-) delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/BugTests.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/MadeUpCases.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestGapMappedToLower.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java delete mode 100644 test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java (limited to 'test/uk/ac/ox/cs/pagoda/global_tests') diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/BugTests.java b/test/uk/ac/ox/cs/pagoda/global_tests/BugTests.java deleted file mode 100644 index 3f14ec7..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/BugTests.java +++ /dev/null @@ -1,240 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; -import org.testng.Assert; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.query.AnswerTuple; -import uk.ac.ox.cs.pagoda.query.AnswerTuples; -import uk.ac.ox.cs.pagoda.query.QueryRecord; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static uk.ac.ox.cs.pagoda.util.TestUtil.getEntityIRI; - -public class BugTests { - - - - @Test - public void minimumCardinalityAxiom2() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - -// OWLClass student = factory.getOWLClass(getEntityIRI("Student")); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(student)); -// OWLClass course = factory.getOWLClass(getEntityIRI("Course")); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(course)); - OWLClass hardWorkingStudent = factory.getOWLClass(getEntityIRI("HardWorkingStudent")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(hardWorkingStudent)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLObjectProperty takesCourse = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "takesCourse"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(takesCourse)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(hardWorkingStudent, a)); // HardWorkingStudent(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(hardWorkingStudent, b)); // HardWorkingStudent(b) - - // Minimum cardinality axiom - manager.addAxiom(ontology, - factory.getOWLEquivalentClassesAxiom(hardWorkingStudent, - factory.getOWLObjectMinCardinality(3, - takesCourse))); - -// manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if (pagoda.preprocess()) { - String query = "select distinct ?x ?y " + - " where { " - + " ?x <" + takesCourse.toStringID() + "> _:z . " - + " ?y <" + takesCourse.toStringID() + "> _:z " + - " }"; - AnswerTuples answers = pagoda.evaluate(query); - int count = 0; - for (AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } - Assert.assertEquals(count, 2); - } - pagoda.dispose(); - } - -// @Test - public void minimumCardinalityAxiom() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass student = factory.getOWLClass(getEntityIRI("Student")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(student)); - OWLClass course = factory.getOWLClass(getEntityIRI("Course")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(course)); - OWLClass hardWorkingStudent = factory.getOWLClass(getEntityIRI("HardWorkingStudent")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(hardWorkingStudent)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLNamedIndividual c1 = factory.getOWLNamedIndividual(getEntityIRI("c1")); - OWLNamedIndividual c2 = factory.getOWLNamedIndividual(getEntityIRI("c2")); - OWLNamedIndividual c3 = factory.getOWLNamedIndividual(getEntityIRI("c3")); - OWLNamedIndividual d1 = factory.getOWLNamedIndividual(getEntityIRI("d1")); - OWLNamedIndividual d2 = factory.getOWLNamedIndividual(getEntityIRI("d2")); - OWLNamedIndividual d3 = factory.getOWLNamedIndividual(getEntityIRI("d3")); - OWLObjectProperty takesCourse = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "takesCourse"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(takesCourse)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(student, a)); // Student(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(student, b)); // Student(b) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, c1)); // Course(c1) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, c2)); // Course(c2) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, c3)); // Course(c3) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, d1)); // Course(d1) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, d2)); // Course(d2) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(course, d3)); // Course(d3) - - // Role assertions - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, a, c1)); // takesCourse(a,c1) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, a, c2)); // takesCourse(a,c2) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, a, c3)); // takesCourse(a,c3) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, b, d1)); // takesCourse(b,d1) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, b, d2)); // takesCourse(b,d2) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(takesCourse, b, d3)); // takesCourse(b,d3) - - // Minimum cardinality axiom - manager.addAxiom(ontology, - factory.getOWLEquivalentClassesAxiom(hardWorkingStudent, - factory.getOWLObjectMinCardinality(3, - takesCourse))); - - manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if (pagoda.preprocess()) { - String query = "select distinct ?x ?y " + - " where { " - + " ?x <" + takesCourse.toStringID() + "> _:z . " - + " ?y <" + takesCourse.toStringID() + "> _:z " + - " }"; - AnswerTuples answers = pagoda.evaluate(query); - int count = 0; - for (AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } - Assert.assertEquals(count, 2); - } - pagoda.dispose(); - } - - /** - * Bug: the relevant ontology is not a subset of the original one. - * - * @throws OWLOntologyCreationException - * @throws IOException - * @throws OWLOntologyStorageException - */ -// @Test - public void rTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass classA = factory.getOWLClass(getEntityIRI("A")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); - OWLClass classB = factory.getOWLClass(getEntityIRI("B")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); - OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "R"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); - OWLObjectProperty roleP = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "P"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleP)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, a)); // A(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, b)); // A(b) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleP, c, a)); // P(c,a) - - // Axioms - // subsetOf(A someValuesFrom(R owl:Thing)) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(classA, - factory.getOWLObjectSomeValuesFrom(roleR, - factory.getOWLThing()))); - - // inverseFunctional(R) - manager.addAxiom(ontology, - factory.getOWLInverseFunctionalObjectPropertyAxiom(roleR)); - - // subsetOf(someValuesFrom(inverseOf(P) owl:thing) B) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleP.getInverseProperty(), - factory.getOWLThing()), - classB)); - /* - * Save the ontology - * */ - -// manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if(pagoda.preprocess()) { - String queryStr = "PREFIX rdf: " + - "select distinct ?x" + - " where { " - + " ?x rdf:type " + classB + - " }"; - QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); - System.out.println(queryRecord); - pagoda.evaluate(queryRecord); - AnswerTuples answers = queryRecord.getAnswers(); - System.out.println("Difficulty: " + queryRecord.getDifficulty()); - for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - } - } - pagoda.dispose(); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java b/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java deleted file mode 100644 index 01e8203..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/CostEvaluation.java +++ /dev/null @@ -1,115 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.semanticweb.owlapi.model.OWLOntology; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.owl.OWLHelper; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner.Type; -import uk.ac.ox.cs.pagoda.tester.PagodaTester; -import uk.ac.ox.cs.pagoda.util.TestUtil; -import uk.ac.ox.cs.pagoda.util.Timer; -import uk.ac.ox.cs.pagoda.util.Utility; - -public class CostEvaluation { - - @Test - public void lubm100() { - int number = 1; - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), - TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"), - TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql") - ); -// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out"); - } - - public void lubm1000() { - int number = 1000; - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), - TestUtil.combinePaths(ontoDir, "lubm/data/lubm" + number + ".ttl"), - TestUtil.combinePaths(ontoDir, "lubm/queries/test_all_pagoda.sparql") - }; - OWLOntology ontology = OWLHelper.loadOntology(args[0]); - QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); - Timer t = new Timer(); - reasoner.loadOntology(ontology); - reasoner.importData(args[1]); - if (!reasoner.preprocess()) - return ; - Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); - - reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); -// AllTests.copy("output/log4j.log", "results-backup/jair/lubm" + number + ".out"); - } - - @Test - public void uobm5() { - int number = 1; - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), - TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql") - }; - PagodaTester.main(args); -// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); - } - - public void uobm100() { - int number = 200; - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), - TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/standard_group3_all.sparql") - }; - PagodaTester.main(args); -// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); - } - - public void uobm500() { - int number = 500; - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), - TestUtil.combinePaths(ontoDir, "uobm/data/uobm" + number + ".ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/standard_all_pagoda.sparql") - }; - - OWLOntology ontology = OWLHelper.loadOntology(args[0]); - QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); - Timer t = new Timer(); - reasoner.loadOntology(ontology); - reasoner.importData(args[1]); - if (!reasoner.preprocess()) - return ; - Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); - - reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); -// AllTests.copy("output/log4j.log", "results-backup/jair/uobm" + number + ".out"); - } - - - public static void main(String... args) { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - args = new String[] { - TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"), - TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"), - TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql") - }; - - OWLOntology ontology = OWLHelper.loadOntology(args[0]); - QueryReasoner reasoner = QueryReasoner.getInstance(Type.ELHOU, ontology, true, true); - Timer t = new Timer(); - reasoner.loadOntology(ontology); - reasoner.importData(args[1]); - if (!reasoner.preprocess()) - return ; - Utility.logInfo("Preprocessing Done in " + t.duration() + " seconds."); - - reasoner.evaluate(reasoner.getQueryManager().collectQueryRecords(args[2])); - } -} 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 deleted file mode 100644 index 18f6cf9..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_PAGOdA.java +++ /dev/null @@ -1,191 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.tester.PagodaTester; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; - -public class JAIR_PAGOdA { - - public static void main(String... args) { - try { - new JAIR_PAGOdA().lubm1(); - } catch(IOException e) { - e.printStackTrace(); - } - } - - @Test - public void lubm1() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), - TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), - TestUtil.combinePaths(ontoDir, "lubm/queries/answersCorrectness.sparql") - }; - PagodaTester.main(args); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda"); - } - - @Test - public void lubm1_conj() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "lubm/univ-bench.owl"), - TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), - TestUtil.combinePaths(ontoDir, "lubm/queries/test_pellet.sparql") - }; - PagodaTester.main(args); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda_conj"); - } - - @Test - public void lubm1_rolledUp() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - "/home/yzhou/backup/20141212/univ-bench-queries.owl", - TestUtil.combinePaths(ontoDir, "lubm/data/lubm1.ttl"), - TestUtil.combinePaths(ontoDir, "lubm/queries/atomic_lubm.sparql") - ); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/lubm1/pagoda_rolledUp"); - } - - @Test - public void uobm1() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), - TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/standard.sparql") - }; - PagodaTester.main(args); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda"); - } - - @Test - public void uobm1_conj() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "uobm/univ-bench-dl.owl"), - TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/standard_pellet.sparql") - }; - PagodaTester.main(args); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda_conj"); - } - - @Test - public void uobm1_rolledUp() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - "/home/yzhou/backup/20141212/univ-bench-dl-queries.owl", - TestUtil.combinePaths(ontoDir, "uobm/data/uobm1.ttl"), - TestUtil.combinePaths(ontoDir, "uobm/queries/atomic_uobm.sparql") - }; - PagodaTester.main(args); -// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uobm1/pagoda_rolledUp"); - } - - @Test - public void fly() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"), - null, - TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") - }; - PagodaTester.main(args); -// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda"); - } - - @Test - public void fly_conj() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl"), - null, - TestUtil.combinePaths(ontoDir, "fly/queries/fly_pellet.sparql") - }; - PagodaTester.main(args); - TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda_conj"); - } - - public void fly_rolledUp() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( -// TestUtil.combinePaths(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl", - TestUtil.combinePaths(ontoDir, "fly/fly-all-in-one_rolledUp.owl"), - null, - TestUtil.combinePaths(ontoDir, "fly/queries/fly_atomic.sparql") - ); -// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/fly/pagoda_rolledUp"); - } - - public void dbpedia() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl"), - TestUtil.combinePaths(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl"), - TestUtil.combinePaths(ontoDir, "dbpedia/queries/atomic_ground.sparql"), - "dbpedia.ans" - ); - -// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/dbpedia/pagoda"); - } - - public void npd() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "npd/npd-all-minus-datatype.owl"), - TestUtil.combinePaths(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl"), - TestUtil.combinePaths(ontoDir, "npd/queries/atomic_ground.sparql") - , "npd.ans" - ); - -// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/npd/pagoda"); - } - - public void reactome() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/reactome_sample_10.ttl"), -// null, -// TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/atomic_ground.sparql") - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/example.sparql") - , "pagoda_reactome.ans" - ); - TestUtil.copyFile("log4j.log", "output/jair/pagoda_reactome.example"); - -// TestUtil.copyFile(("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/pagoda_10p"); - } - - public void chembl() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/graph sampling/sample_1.nt"), -// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql") - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/example.sparql") - , "pagoda_chembl.ans" - ); - TestUtil.copyFile("log4j.log", "output/jair/pagoda_chembl.example"); -// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/pagoda_1p"); - } - - public void uniprot() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - PagodaTester.main( - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/graph sampling/sample_1.nt"), -// null, -// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql") - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/example.sparql") - , "pagoda_uniprot.ans" - ); - TestUtil.copyFile("log4j.log", "output/jair/pagoda_uniprot.example"); -// TestUtil.copyFile("output/log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/pagoda_1p"); - } - -} 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 deleted file mode 100644 index 01f3568..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/JAIR_Scalability.java +++ /dev/null @@ -1,91 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.tester.PagodaTester; -import uk.ac.ox.cs.pagoda.util.PagodaProperties; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; - -public class JAIR_Scalability { - - private static final String date = "_0123"; - - public static void main(String... args) throws IOException { - PagodaProperties.shellModeDefault = true; - new JAIR_Scalability().testUniProt(50, false); - } - - @Test - public void reactome() throws IOException { - testReactome(10, false); - } - - @Test - public void chembl() throws IOException { - testChEMBL(1, false); - } - - @Test - public void uniprot() throws IOException { - testUniProt(1, false); - } - - public void testReactome(int percentage, boolean save) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/biopax-level3-processed.owl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/graph sampling/simplifed_sample_" + percentage + ".ttl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/reactome/queries/answersCorrectness.sparql") - , "reactome.ans" - }; - if (percentage == 10) - args[1] = args[1].replace("simplifed", "reactome"); - - PagodaTester.main(args); - if (save) - TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/reactome/pagoda_" + percentage + "p" + date); - } - - public void testChEMBL(int percentage, boolean save) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/cco-noDPR.ttl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/sample_" + percentage + ".nt"), -// TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/atomic_ground.sparql") - TestUtil.combinePaths(ontoDir, "bio2rdf/chembl/queries/answersCorrectness.sparql") - , "chembl.ans" - }; - if (percentage == 1 || percentage == 10 || percentage == 50) - args[1] = args[1].replace("chembl", "chembl/graph sampling"); - else - if (percentage == 100) - args[1] = "/home/yzhou/RDFData/ChEMBL/facts/ChEMBL.ttl"; - - PagodaTester.main(args); - if (save) - TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/chembl/pagoda_" + percentage + "p" + date); - } - - public void testUniProt(int percentage, boolean save) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - String[] args = new String[] { - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/core-sat-processed.owl"), - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/sample_" + percentage + ".nt"), -// TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/atomic_ground.sparql") - TestUtil.combinePaths(ontoDir, "bio2rdf/uniprot/queries/answersCorrectness.sparql") - , "uniprot.ans" - }; - - if (percentage == 1 || percentage == 10 || percentage == 50) - args[1] = args[1].replace("uniprot", "uniprot/graph sampling"); - else - if (percentage == 100) - args[1] = "/home/yzhou/krr-nas-share/Yujiao/ontologies/bio2rdf/uniprot/data/uniprot_cleaned.nt"; - - PagodaTester.main(args); - if (save) - TestUtil.copyFile("log4j.log", "/home/yzhou/java-workspace/answersCorrectness-share/results_new/uniprot/pagoda_" + percentage + "p" + date); - } - -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java b/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java deleted file mode 100644 index 3551b9b..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/LightEvaluation.java +++ /dev/null @@ -1,18 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; - -import java.io.IOException; - -@Deprecated -public class LightEvaluation { - - @Test - public void evaluation() throws IOException { - new TestPagodaUOBM().answersCorrectness(1); - new TestPagodaLUBM().answersCorrectness(100); -// new TestPagodaFLY().answersCorrectness(); - new TestPagodaDBPedia().answersCorrectness(); - new TestPagodaNPD().testNPDwithoutDataType(); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/MadeUpCases.java b/test/uk/ac/ox/cs/pagoda/global_tests/MadeUpCases.java deleted file mode 100644 index 3d154cb..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/MadeUpCases.java +++ /dev/null @@ -1,77 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; -import org.testng.Assert; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.query.AnswerTuple; -import uk.ac.ox.cs.pagoda.query.AnswerTuples; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; - -import static uk.ac.ox.cs.pagoda.util.TestUtil.getEntityIRI; - -public class MadeUpCases { - - @Test(groups = {"existential"}) - public void someTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass A1 = factory.getOWLClass(getEntityIRI("A1")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A1)); - OWLClass A2 = factory.getOWLClass(getEntityIRI("A2")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A2)); - OWLClass A3 = factory.getOWLClass(getEntityIRI("A3")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A3)); - OWLClass A4 = factory.getOWLClass(getEntityIRI("A4")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A4)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLObjectProperty R = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "R"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(R)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(A1, a)); - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(A1, b)); - - // Minimum cardinality axiom - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A1, factory.getOWLObjectSomeValuesFrom(R, A2))); - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A2, factory.getOWLObjectSomeValuesFrom(R, A3))); - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A3, factory.getOWLObjectSomeValuesFrom(R, A4))); - manager.addAxiom(ontology, factory.getOWLTransitiveObjectPropertyAxiom(R)); - -// manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if (pagoda.preprocess()) { - String query = "select distinct ?x ?y " + - " where { " - + " ?x <" + R.toStringID() + "> _:z . " - + " ?y <" + R.toStringID() + "> _:z " + - " }"; - AnswerTuples answers = pagoda.evaluate(query); - int count = 0; - for (AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } - Assert.assertEquals(count, 2); - } - pagoda.dispose(); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java b/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java deleted file mode 100644 index 2fc682b..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/SkolemisationTests.java +++ /dev/null @@ -1,269 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; -import org.testng.Assert; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.query.AnswerTuple; -import uk.ac.ox.cs.pagoda.query.AnswerTuples; -import uk.ac.ox.cs.pagoda.query.QueryRecord; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class SkolemisationTests { - - public static final String NS = "http://example.org/test#%s"; - - private IRI getEntityIRI(String name) { - return IRI.create(String.format(NS, name)); - } - -// @Test - public void commonSuccessorTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass classA = factory.getOWLClass(getEntityIRI("A")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); - OWLClass classB = factory.getOWLClass(getEntityIRI("B")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); - OWLClass classC = factory.getOWLClass(getEntityIRI("C")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); - OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); - OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); - OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, c)); // A(c) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, d)); // A(d) - - // Minimum cardinality axiom - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(classA, - factory.getOWLObjectUnionOf( - factory.getOWLObjectSomeValuesFrom(roleR, classB), - factory.getOWLObjectSomeValuesFrom(roleR, classC)))); - - /* - * Save the ontology - * */ - -// manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if(pagoda.preprocess()) { - String queryStr = "select distinct ?x ?y " + - " where { " - + " ?x <" + roleR.toStringID() + "> _:z . " - + " ?y <" + roleR.toStringID() + "> _:z " + - " }"; - QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); - pagoda.evaluate(queryRecord); - AnswerTuples answers = queryRecord.getAnswers(); - System.out.println("Difficulty: " + queryRecord.getDifficulty()); - int count = 0; - for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } - Assert.assertEquals(count, 2); - } - pagoda.dispose(); - } - -// @Test - public void yTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass classA = factory.getOWLClass(getEntityIRI("A")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); - OWLClass classB = factory.getOWLClass(getEntityIRI("B")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); - OWLClass classC = factory.getOWLClass(getEntityIRI("C")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); - OWLClass classD = factory.getOWLClass(getEntityIRI("D")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classD)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); - OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); - OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); - OWLObjectProperty roleS = factory.getOWLObjectProperty(IRI.create(String.format(NS, "S"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleS)); - OWLObjectProperty roleP = factory.getOWLObjectProperty(IRI.create(String.format(NS, "P"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleP)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classD, a)); // D(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classD, b)); // D(b) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleS, c, a)); // S(c,a) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleP, d, b)); // P(d,b) - - // Axioms - // subsetOf(D someValuesFrom(R owl:Thing)) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(classD, - factory.getOWLObjectSomeValuesFrom(roleR, - factory.getOWLThing()))); - // subsetOf(someValuesFrom(inverseOf(S) owl:Thing) allValuesFrom(R A)) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleS.getInverseProperty(), - factory.getOWLThing()), - factory.getOWLObjectAllValuesFrom(roleR, classA))); - // subsetOf(someValuesFrom(inverseOf(P) owl:Thing) B) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleP.getInverseProperty(), - factory.getOWLThing()), - classB)); - // subsetOf(someValuesFrom(R A) C) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleR, classA), classC)); - - /* - * Save the ontology - * */ - - manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if(pagoda.preprocess()) { - String queryStr = "PREFIX rdf: " + - "select distinct ?x" + - " where { " -// + " ?x rdf:type " + classB + " ." -// + " ?x " + roleR + " "+ "_:y . " - + " ?x rdf:type " + classC + - " }"; - QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); - System.out.println(queryRecord); - pagoda.evaluate(queryRecord); - AnswerTuples answers = queryRecord.getAnswers(); - System.out.println("Difficulty: " + queryRecord.getDifficulty()); - int count = 0; - for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } -// Assert.assertEquals(count, 1); - } - pagoda.dispose(); - } - - @Test - public void rTest() throws OWLOntologyCreationException, IOException, OWLOntologyStorageException { - - /* - * Build test ontology - * */ - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass classA = factory.getOWLClass(getEntityIRI("A")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classA)); - OWLClass classB = factory.getOWLClass(getEntityIRI("B")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classB)); -// OWLClass classC = factory.getOWLClass(getEntityIRI("C")); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classC)); -// OWLClass classD = factory.getOWLClass(getEntityIRI("D")); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(classD)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); -// OWLNamedIndividual d = factory.getOWLNamedIndividual(getEntityIRI("d")); - OWLObjectProperty roleR = factory.getOWLObjectProperty(IRI.create(String.format(NS, "R"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleR)); -// OWLObjectProperty roleF = factory.getOWLObjectProperty(IRI.create(String.format(NS, "F"))); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleF)); - OWLObjectProperty roleP = factory.getOWLObjectProperty(IRI.create(String.format(NS, "P"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleP)); -// OWLObjectProperty roleL = factory.getOWLObjectProperty(IRI.create(String.format(NS, "L"))); -// manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(roleL)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, a)); // A(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(classA, b)); // A(b) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(roleP, c, a)); // P(c,a) - - // Axioms - // subsetOf(A someValuesFrom(R owl:Thing)) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(classA, - factory.getOWLObjectSomeValuesFrom(roleR, - factory.getOWLThing()))); - - // inverseFunctional(R) - manager.addAxiom(ontology, - factory.getOWLInverseFunctionalObjectPropertyAxiom(roleR)); - - // subsetOf(someValuesFrom(inverseOf(P) owl:thing) B) - manager.addAxiom(ontology, - factory.getOWLSubClassOfAxiom(factory.getOWLObjectSomeValuesFrom(roleP.getInverseProperty(), - factory.getOWLThing()), - classB)); - /* - * Save the ontology - * */ - - manager.saveOntology(ontology, Files.newOutputStream(Paths.get("/home/alessandro/Desktop/test-ontology.owl"))); - - /* - * Test one query - * */ - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if(pagoda.preprocess()) { - String queryStr = "PREFIX rdf: " + - "select distinct ?x" + - " where { " - + " ?x rdf:type " + classB + - " }"; - QueryRecord queryRecord = pagoda.getQueryManager().create(queryStr); - System.out.println(queryRecord); - pagoda.evaluate(queryRecord); - AnswerTuples answers = queryRecord.getAnswers(); - System.out.println("Difficulty: " + queryRecord.getDifficulty()); - int count = 0; - for(AnswerTuple ans; answers.isValid(); answers.moveNext()) { - ans = answers.getTuple(); - TestUtil.logInfo(ans); - count++; - } -// Assert.assertEquals(count, 1); - } - pagoda.dispose(); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestGapMappedToLower.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestGapMappedToLower.java deleted file mode 100644 index 4b1ec6d..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestGapMappedToLower.java +++ /dev/null @@ -1,68 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import junit.framework.Assert; -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.query.AnswerTuple; -import uk.ac.ox.cs.pagoda.query.AnswerTuples; -import uk.ac.ox.cs.pagoda.reasoner.QueryReasoner; -import uk.ac.ox.cs.pagoda.util.Namespace; - -public class TestGapMappedToLower { - - public static final String ns = "http://example.org/test#%s"; - - public IRI getEntityIRI(String name) { - return IRI.create(String.format(ns, name)); - } - - @Test - public void test() throws OWLOntologyCreationException { - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - OWLClass A = factory.getOWLClass(getEntityIRI("A")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A)); - OWLClass B = factory.getOWLClass(getEntityIRI("B")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(B)); - OWLClass C = factory.getOWLClass(getEntityIRI("C")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(C)); - OWLClass A1 = factory.getOWLClass(getEntityIRI("A1")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A1)); - OWLClass A2 = factory.getOWLClass(getEntityIRI("A2")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(A2)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLNamedIndividual c = factory.getOWLNamedIndividual(getEntityIRI("c")); - OWLObjectProperty r = factory.getOWLObjectProperty(IRI.create(String.format(ns, "r"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(r)); - - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(A, a)); // A(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(B, b)); // B(b) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(C, c)); // C(c) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(r, a, b)); // r(a,b) - manager.addAxiom(ontology, factory.getOWLObjectPropertyAssertionAxiom(r, a, c)); // r(a,c) - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A, factory.getOWLObjectUnionOf(A1, A2))); // A \sqsubseteq A1 \sqcup A2 - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A1, factory.getOWLObjectMaxCardinality(1, r))); // A1 \sqsubseteq \leq 1 r.\top - manager.addAxiom(ontology, factory.getOWLSubClassOfAxiom(A2, factory.getOWLObjectMaxCardinality(1, r))); // A2 \sqsubseteq \leq 1 r.\top - - QueryReasoner pagoda = QueryReasoner.getInstance(ontology); - pagoda.loadOntology(ontology); - if (pagoda.preprocess()) { - String sparql = "select ?x where { " - + "?x <" + r.toStringID() + "> ?y . " - + "?y " + Namespace.RDF_TYPE_QUOTED + " <" + B.toStringID() + "> . " - + "?y " + Namespace.RDF_TYPE_QUOTED + " <" + C.toStringID() + "> . } "; - AnswerTuples rs = pagoda.evaluate(sparql); - int count = 0; - for (AnswerTuple ans; rs.isValid(); rs.moveNext()) { - ans = rs.getTuple(); - System.out.println(ans.getGroundTerm(0)); - ++count; - } - Assert.assertEquals(1, count); - } - } - -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java deleted file mode 100644 index 3642147..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaDBPedia.java +++ /dev/null @@ -1,33 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; -import java.nio.file.Paths; - -public class TestPagodaDBPedia { - - public static final String ANSWER_PATH = "~/TestPagodaDEBPedia.json"; - - @Test - public void just_execute() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "dbpedia/integratedOntology-all-in-one-minus-datatype.owl")) - .data(Paths.get(ontoDir, "dbpedia/data/dbpedia-minus-datatype-new.ttl")) - .query(Paths.get(ontoDir, "dbpedia/atomic.sparql")) - .answer(ANSWER_PATH) - .classify(true) - .hermit(true) - .build(); - pagoda.run(); - } - - @Test - public void answersCorrectness() { - // TODO implement - } - -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java deleted file mode 100644 index 3eb956f..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaFLY.java +++ /dev/null @@ -1,107 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.query.CheckAnswers; -import uk.ac.ox.cs.pagoda.util.PagodaProperties; -import uk.ac.ox.cs.pagoda.util.TestUtil; -import uk.ac.ox.cs.pagoda.util.Timer; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -public class TestPagodaFLY { - - // @Test(groups = {"light"}) - public void answersCorrectness_withGJFC() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); - new File(answers.toString()).deleteOnExit(); - Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-with-GJ-FC-individuals.json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl")) - .query(Paths.get(ontoDir, "fly/queries/fly.sparql")) - .answer(answers) - .classify(false) - .build(); - - pagoda.run(); - CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"light", "correctness"}) - public void answersCorrectness_rolledUp() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); - new File(answers.toString()).deleteOnExit(); - Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-fly-rolledup.json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) - .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql")) - .answer(answers) -// .answer(Paths.get("/home/alessandro/Desktop/answers.json")) - .classify(false) - .build(); - - pagoda.run(); - CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"light", "justExecute", "nonOriginal", "existential"}) - public void justExecute_newQueries() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() -// .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) - .ontology(Paths.get(ontoDir, "fly/fly_anatomy_XP_with_GJ_FC_individuals.owl")) -// .query(Paths.get(ontoDir, "fly/queries/fly_rolledUp.sparql")) -// .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql")) - .query("/home/alessandro/Desktop/query-8.sparql") -// .answer(Paths.get("/home/alessandro/Desktop/answers.json")) - .classify(false) - .hermit(true) - .skolemDepth(3) - .skolem(PagodaProperties.SkolemUpperBoundOptions.BEFORE_SUMMARISATION) - .build() - .run(); - } - - @Test(groups = {"comparison"}) - public void compare_newQueries() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Timer timer = new Timer(); - Pagoda.builder() - .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) - .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql")) - .classify(false) - .hermit(true) - .skolem(PagodaProperties.SkolemUpperBoundOptions.AFTER_SUMMARISATION) // <----<< Skolem upper bound is ENABLED <<< - .build() - .run(); - double t1 = timer.duration(); - - timer.reset(); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "fly/fly_rolledUp.owl")) - .query(Paths.get(ontoDir, "fly/queries/new_queries.sparql")) - .classify(false) - .hermit(true) - .skolem(PagodaProperties.SkolemUpperBoundOptions.DISABLED) // <----<< Skolem upper bound is DISABLED <<< - .build() - .run(); - double t2 = timer.duration(); - - if(t1 < t2) - TestUtil.logInfo( - "Overall reasoning with Skolem upper bound was " + (int) (t2 / t1 * 100 - 100) + "x faster!"); - else - TestUtil.logInfo( - "Overall reasoning with Skolem upper bound was " + (int) (t1 / t2 * 100 - 100) + "x slower..."); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java deleted file mode 100644 index 019fafa..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaLUBM.java +++ /dev/null @@ -1,92 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.query.CheckAnswers; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -public class TestPagodaLUBM { - - public void answersCorrectness(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); - new File(answers.toString()).deleteOnExit(); - Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-lubm" + number + ".json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) - .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) - .query(Paths.get(ontoDir, "lubm/queries/test.sparql")) - .answer(answers) - .build(); - - pagoda.run(); - CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"light", "correctness"}) - public void answersCorrectness_1() throws IOException { - answersCorrectness(1); - } - - public void justExecute_sygenia(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); -// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); -// new File(answers.toString()).deleteOnExit(); -// Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-lubm" + number + ".json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) - .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) - .query(Paths.get(ontoDir, "lubm/queries/lubm_sygenia.sparql")) -// .answer(answers) - .build(); - - pagoda.run(); -// CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"sygenia"}) - public void justExecute_sygenia_1() throws IOException { - justExecute_sygenia(1); - } - - public void justExecute_sygenia_allBlanks(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); -// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); -// new File(answers.toString()).deleteOnExit(); -// Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-lubm" + number + ".json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) - .data(Paths.get(ontoDir, "lubm/data/lubm" + number + ".ttl")) - .query(Paths.get(ontoDir, "lubm/queries/lubm_sygenia_all-blanks.sparql")) -// .answer(answers) - .build(); - - pagoda.run(); -// CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"sygenia"}) - public void justExecute_sygenia_1_allBlanks() throws IOException { - justExecute_sygenia_allBlanks(1); - } - - @Test(groups = {"existential"}) - public void justExecute_feier() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "lubm/univ-bench.owl")) - .data(Paths.get(ontoDir, "lubm/data/lubm1.ttl")) - .query(Paths.get(ontoDir, "lubm/queries/queries_from_rules.sparql")) - .build() - .run(); - } -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java deleted file mode 100644 index 939ee6e..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaNPD.java +++ /dev/null @@ -1,38 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; -import java.nio.file.Paths; - -public class TestPagodaNPD { - - public static final String ANSWER_PATH = "~/PagodaNPDWithoutDatatype.json"; - - @Test - public void justExecuteNPDWithoutDataType() { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "npd/npd-all-minus-datatype.owl")) - .data(Paths.get(ontoDir, "npd/data/npd-data-dump-minus-datatype-new.ttl")) - .query(Paths.get(ontoDir, "npd/queries/atomic.sparql")) - .answer(ANSWER_PATH) - .classify(true) - .hermit(true) - .build(); - pagoda.run(); - } - - @Test - public void testNPDwithoutDataType() throws IOException { - // TODO implement - } - - @Test - public void testNPD() throws IOException { - // TODO implement - } - -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java deleted file mode 100644 index 8a8a596..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaReactome.java +++ /dev/null @@ -1,53 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.IOException; -import java.nio.file.Paths; - -public class TestPagodaReactome { - - @Test(groups = {"justExecute"}) - public void justExecute() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "reactome/biopax-level3-processed.owl")) - .data(Paths.get(ontoDir, "reactome/data/sample_10.ttl")) - .query(Paths.get(ontoDir, "reactome/test.sparql")) - .classify(true) - .hermit(true) - .build() - .run(); - } - - @Test(groups = {"sygenia"}) - public void justExecute_sygenia() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "reactome/biopax-level3-processed.owl")) - .data(Paths.get(ontoDir, "reactome/data/sample_10.ttl")) - .query(Paths.get(ontoDir, "reactome/reactome_sygenia_queries.sparql")) - .classify(true) - .hermit(true) - .build() - .run(); - } - - @Test(groups = {"existential"}) - public void justExecute_existential() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "reactome/biopax-level3-processed.owl")) - .data(Paths.get(ontoDir, "reactome/data/sample_10.ttl")) - .query(Paths.get(ontoDir, "reactome/existential_queries.sparql")) -// .query(Paths.get(ontoDir, "reactome/Queries_by_Feier-et-al.sparql")) - .build() - .run(); - } - -} diff --git a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java b/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java deleted file mode 100644 index 4dae223..0000000 --- a/test/uk/ac/ox/cs/pagoda/global_tests/TestPagodaUOBM.java +++ /dev/null @@ -1,122 +0,0 @@ -package uk.ac.ox.cs.pagoda.global_tests; - -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.Pagoda; -import uk.ac.ox.cs.pagoda.query.CheckAnswers; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -public class TestPagodaUOBM { - - private static final int N_1 = 1; - private static final int N_2 = 4; - - @DataProvider(name = "UOBMNumbers") - private static Object[][] UOBMNumbers() { - Integer[][] integers = new Integer[N_2 - N_1 + 1][1]; - for(int i = 0; i < N_2 - N_1 + 1; i++) - integers[i][0] = N_1 + i; - return integers; - } - - @Test(groups = {"light", "correctness"}) - public void answersCorrectness_1() throws IOException { - answersCorrectness(1); - } - - @Test(groups = {"heavy", "correctness"}, dataProvider = "UOBMNumbers") - public void answersCorrectness(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); - new File(answers.toString()).deleteOnExit(); - Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) - .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) - .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) - .answer(answers) - .build(); - - pagoda.run(); - CheckAnswers.assertSameAnswers(answers, givenAnswers); - } - - @Test(groups = {"sygenia"}) - public void answersCorrectness_sygenia_1() throws IOException { - answersCorrectness_sygenia(1); - } - - @Test(groups = {"heavy",}, dataProvider = "UOBMNumbers") - public void answersCorrectness_sygenia(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); -// Path answers = Paths.get(File.createTempFile("answers", ".json").getAbsolutePath()); -// new File(answers.toString()).deleteOnExit(); -// Path givenAnswers = TestUtil.getAnswersFilePath("answers/pagoda-uobm" + number + ".json"); - - Pagoda pagoda = Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) - .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) - .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia.sparql")) - .build(); - - pagoda.run(); - } - - @Test(groups = {"sygenia"}) - public void answersCorrectness_sygenia_allBlanks_1() throws IOException { - answersCorrectness_sygenia(1); - } - - @Test(groups = {"heavy"}, dataProvider = "UOBMNumbers") - public void answersCorrectness_sygenia_allBlanks(int number) throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) - .data(Paths.get(ontoDir, "uobm/data/uobm" + number + ".ttl")) - .query(Paths.get(ontoDir, "uobm/queries/uobm_sygenia_all-blanks.sparql")) - .build() - .run(); - } - - @Test(groups = {"justExecute", "heavy", "nonOriginal", "existential"}) - public void justExecute_modifiedUOBM() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm_modified/univ-bench-dl-modified.owl")) - .data(Paths.get(ontoDir, "uobm_modified/data/uobm1.ttl")) - .query(Paths.get(ontoDir, "uobm_modified/queries/additional_queries.sparql")) - .build() - .run(); - } - - @Test(groups = {"justExecute"}) - public void justExecute_additionalQueries() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - - Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) - .data(Paths.get(ontoDir, "uobm/data/uobm1.ttl")) - .query(Paths.get(ontoDir, "uobm/queries/additional_queries.sparql")) - .build() - .run(); - } - - @Test(groups = {"justExecute", "UOBM50"}) - public void justExecuteUOBM_50() throws IOException { - String ontoDir = TestUtil.getConfig().getProperty("ontoDir"); - Pagoda.builder() - .ontology(Paths.get(ontoDir, "uobm/univ-bench-dl.owl")) - .data(Paths.get(ontoDir, "uobm/data/uobm50.ttl")) - .query(Paths.get(ontoDir, "uobm/queries/test.sparql")) - .build() - .run(); - } -} -- cgit v1.2.3