From e02ad77cefc3005e36ae48fe47bf7914007f094a Mon Sep 17 00:00:00 2001 From: yzhou Date: Fri, 22 May 2015 05:17:31 +0100 Subject: turned on the LOG switch in Utility added a tracking rule for inequality in TrackingRuleEncoderWithGap added a testcase in ClauseTester --- test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java') diff --git a/test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java b/test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java index d23f186..ff98b3c 100644 --- a/test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java +++ b/test/uk/ac/ox/cs/pagoda/junit/ClauseTester.java @@ -8,6 +8,7 @@ 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.Individual; import org.semanticweb.HermiT.model.Variable; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.OWLOntology; @@ -17,7 +18,31 @@ import uk.ac.ox.cs.pagoda.approx.Clause; import uk.ac.ox.cs.pagoda.approx.Clausifier; public class ClauseTester { + + public void test_clause(Atom[] headAtoms, Atom[] bodyAtoms) { + OWLOntologyManager m = OWLManager.createOWLOntologyManager(); + OWLOntology emptyOntology = null; + try { + emptyOntology = m.createOntology(); + } catch (Exception e) { + e.printStackTrace(); + 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_nominal() { + Variable x = Variable.create("X"); + AtomicRole r = AtomicRole.create("r"); + Individual o = Individual.create("o"); + Atom[] bodyAtoms = new Atom[] { Atom.create(r, x, o) }; + AtomicConcept A = AtomicConcept.create("A"); + Atom[] headAtoms = new Atom[] { Atom.create(A, x) }; + test_clause(headAtoms, bodyAtoms); + } + @Test public void test_simple() { Variable x = Variable.create("X"), y1 = Variable.create("y1"), y2 = Variable.create("y2"); -- cgit v1.2.3