From 1b6a128137e5d7a6ff75566869232fc054afabef Mon Sep 17 00:00:00 2001 From: RncLsn Date: Fri, 15 May 2015 17:32:22 +0100 Subject: Testing and fixing. Executed successfully on UOBM{1,2,3,4,5,6,7,8}. --- .../ac/ox/cs/pagoda/test_units/ClauseTester.java | 164 --------------------- 1 file changed, 164 deletions(-) delete mode 100644 test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java (limited to 'test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java') diff --git a/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java b/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java deleted file mode 100644 index a0f16d4..0000000 --- a/test/uk/ac/ox/cs/pagoda/test_units/ClauseTester.java +++ /dev/null @@ -1,164 +0,0 @@ -package uk.ac.ox.cs.pagoda.test_units; - -import org.semanticweb.HermiT.model.Atom; -import org.semanticweb.HermiT.model.AtomicConcept; -import org.semanticweb.HermiT.model.AtomicRole; -import org.semanticweb.HermiT.model.DLClause; -import org.semanticweb.HermiT.model.Equality; -import org.semanticweb.HermiT.model.Variable; -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.OWLOntology; -import org.semanticweb.owlapi.model.OWLOntologyManager; - -import org.testng.Assert; -import org.testng.annotations.Test; -import uk.ac.ox.cs.pagoda.approx.Clause; -import uk.ac.ox.cs.pagoda.approx.Clausifier; - -public class ClauseTester { - - @Test - public void test_simple() { - Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"); - AtomicConcept A = AtomicConcept.create("A"); - AtomicRole r = AtomicRole.create("r"); - Atom[] bodyAtoms = new Atom[] { - Atom.create(A, x), - Atom.create(r, x, y1), - Atom.create(r, x, y2) - }; - - Atom[] headAtoms = new Atom[] { - Atom.create(Equality.INSTANCE, y1, y2) - }; - - OWLOntologyManager m = OWLManager.createOWLOntologyManager(); - OWLOntology emptyOntology = null; - try { - emptyOntology = m.createOntology(); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail("failed to create a new ontology"); - } - Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms)); - System.out.println(c.toString()); - } - - @Test - public void test_more() { - Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"), y3 = Variable.create("y3"); - AtomicConcept A = AtomicConcept.create("A"); - AtomicRole r = AtomicRole.create("r"); - Atom[] bodyAtoms = new Atom[] { - Atom.create(A, x), - Atom.create(r, x, y1), - Atom.create(r, x, y2), - Atom.create(r, x, y3), - }; - - Atom[] headAtoms = new Atom[] { - Atom.create(Equality.INSTANCE, y1, y2), - Atom.create(Equality.INSTANCE, y1, y3), - Atom.create(Equality.INSTANCE, y2, y3) - }; - - OWLOntologyManager m = OWLManager.createOWLOntologyManager(); - OWLOntology emptyOntology = null; - try { - emptyOntology = m.createOntology(); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail("failed to create a new ontology"); - } - Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms)); - System.out.println(c.toString()); - } - - @Test - public void test_inverse() { - Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"); - AtomicConcept A = AtomicConcept.create("A"); - AtomicRole r = AtomicRole.create("r"); - Atom[] bodyAtoms = new Atom[] { - Atom.create(A, x), - Atom.create(r, y1, x), - Atom.create(r, y2, x) - }; - - Atom[] headAtoms = new Atom[] { - Atom.create(Equality.INSTANCE, y1, y2) - }; - - OWLOntologyManager m = OWLManager.createOWLOntologyManager(); - OWLOntology emptyOntology = null; - try { - emptyOntology = m.createOntology(); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail("failed to create a new ontology"); - } - Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms)); - System.out.println(c.toString()); - } - - @Test - public void test_fillter() { - Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"); - AtomicConcept A = AtomicConcept.create("A"); - AtomicConcept B = AtomicConcept.create("B"); - AtomicRole r = AtomicRole.create("r"); - Atom[] bodyAtoms = new Atom[] { - Atom.create(A, x), - Atom.create(r, y1, x), - Atom.create(r, y2, x), - Atom.create(B, y1), - Atom.create(B, y2) - }; - - Atom[] headAtoms = new Atom[] { - Atom.create(Equality.INSTANCE, y1, y2) - }; - - OWLOntologyManager m = OWLManager.createOWLOntologyManager(); - OWLOntology emptyOntology = null; - try { - emptyOntology = m.createOntology(); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail("failed to create a new ontology"); - } - Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms)); - System.out.println(c.toString()); - } - - @Test - public void test_negFillter() { - Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"); - AtomicConcept A = AtomicConcept.create("A"); - AtomicConcept B = AtomicConcept.create("B"); - AtomicRole r = AtomicRole.create("r"); - Atom[] bodyAtoms = new Atom[] { - Atom.create(A, x), - Atom.create(r, y1, x), - Atom.create(r, y2, x) - }; - - Atom[] headAtoms = new Atom[] { - Atom.create(Equality.INSTANCE, y1, y2), - Atom.create(B, y1), - Atom.create(B, y2) - }; - - OWLOntologyManager m = OWLManager.createOWLOntologyManager(); - OWLOntology emptyOntology = null; - try { - emptyOntology = m.createOntology(); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail("failed to create a new ontology"); - } - Clause c = new Clause(Clausifier.getInstance(emptyOntology), DLClause.create(headAtoms, bodyAtoms)); - System.out.println(c.toString()); - } - -} -- cgit v1.2.3