final public ElkClass clazz() throws ParseException {ElkIri x; x = iri(); {if ("" != null) return getElkObjectFactory().getClass(x);} throw new Error("Missing return statement in function"); }
@Test public void testSatisfiabilityExistential() throws ElkException { TestLoader loader = new TestLoader(); Reasoner reasoner = TestReasonerUtils.createTestReasoner(loader); ElkClass A = objectFactory.getClass(new ElkFullIri(":A")); ElkClass B = objectFactory.getClass(new ElkFullIri(":B")); loader.add(objectFactory.getSubClassOfAxiom(A, objectFactory.getOwlNothing())); ElkObjectProperty R = objectFactory.getObjectProperty(new ElkFullIri( ":R")); assertFalse(reasoner.isSatisfiable(objectFactory .getObjectSomeValuesFrom(R, A))); assertTrue(reasoner.isSatisfiable(objectFactory .getObjectSomeValuesFrom(R, B))); }
@Test @SuppressWarnings("static-method") public void testDuplicateInferenceOfReflexiveExistential() throws Exception { Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/DuplicateReflexiveExistential.owl")); ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkObjectProperty r = factory .getObjectProperty(new ElkFullIri("http://example.org/R")); ElkClass c = factory.getClass(new ElkFullIri("http://example.org/C")); ElkClassExpression rSomeC = factory.getObjectSomeValuesFrom(r, c); TracingTestUtils.checkTracingCompleteness(a, rSomeC, reasoner); }
private ElkClass getClass(String name) { return elkFactory_.getClass(getIri(name)); }
private ElkClass getClass(String name) { return elkFactory_.getClass(getIri(name)); }
private ElkClass createElkClass(String name) { return objectFactory.getClass(new ElkAbbreviatedIri(p, name)); }
ElkClass createElkClass(String name) { return objectFactory.getClass(new ElkAbbreviatedIri(p, name)); }
private ElkClass getClass(String name) { return elkFactory_.getClass(getIri(name)); }
@Test @SuppressWarnings("static-method") public void testRecursiveTracingComposition() throws Exception { ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/RecursiveComposition.owl")); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkObjectProperty r = factory .getObjectProperty(new ElkFullIri("http://example.org/R")); ElkClass c = factory.getClass(new ElkFullIri("http://example.org/C")); ElkClassExpression rSomeC = factory.getObjectSomeValuesFrom(r, c); TracingTestUtils.checkTracingCompleteness(a, rSomeC, reasoner); }
@Test public void testSimpleSubsumption() throws ElkException { TestLoader loader = new TestLoader(); Reasoner reasoner = TestReasonerUtils.createTestReasoner(loader); ElkClass A = objectFactory.getClass(new ElkFullIri(":A")); ElkClass B = objectFactory.getClass(new ElkFullIri(":B")); loader.add(objectFactory.getSubClassOfAxiom(A, B)); assertFalse(reasoner.isSatisfiable(objectFactory .getObjectIntersectionOf(A, objectFactory.getObjectComplementOf(B)))); assertTrue(reasoner.isSatisfiable(objectFactory .getObjectIntersectionOf(B, objectFactory.getObjectComplementOf(A)))); }
@Test @SuppressWarnings("static-method") public void testRecursiveTracingExistential() throws Exception { ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/RecursiveExistential.owl")); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkObjectProperty r = factory .getObjectProperty(new ElkFullIri("http://example.org/R")); ElkClass c = factory.getClass(new ElkFullIri("http://example.org/C")); ElkClassExpression rSomeC = factory.getObjectSomeValuesFrom(r, c); TracingTestUtils.checkTracingCompleteness(a, rSomeC, reasoner); }
@Test public void testEquivalentClasses() throws ElkException { Reasoner reasoner = TestReasonerUtils.createTestReasoner( new EmptyAxiomLoader()); // empty ontology, query for conjunction ElkClass A = objectFactory.getClass(new ElkFullIri(":A")); ElkClass B = objectFactory.getClass(new ElkFullIri(":B")); ElkClassExpression queryExpression = objectFactory .getObjectIntersectionOf(A, B); assertEquals(0, reasoner.getEquivalentClasses(queryExpression).size()); // the following has reproduced Issue 23: assertEquals(0, reasoner.getEquivalentClasses(queryExpression).size()); }
@Override public ElkClass getClass(ElkIri iri) { return filter(factory_.getClass(iri)); }
@Override public ElkClass getClass(ElkIri iri) { return filter(factory_.getClass(iri)); }
@Override public ElkClass getClass(ElkIri iri) { return filter(factory_.getClass(iri)); }
@Test @SuppressWarnings("static-method") public void testAvoidTracingDueToCyclicInferences() throws Exception { ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/TrivialPropagation.owl")); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkClass a1 = factory.getClass(new ElkFullIri("http://example.org/A1")); TracingTestUtils.checkTracingCompleteness(a, a1, reasoner); }
@Test @SuppressWarnings("static-method") public void testDuplicateInferenceOfExistential() throws Exception { Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/DuplicateExistential.owl")); ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkClass d = factory.getClass(new ElkFullIri("http://example.org/D")); ElkClass e = factory.getClass(new ElkFullIri("http://example.org/E")); TracingTestUtils.checkTracingCompleteness(a, d, reasoner); TracingTestUtils.checkTracingCompleteness(e, d, reasoner); }
@Test @SuppressWarnings("static-method") public void testDuplicateInferenceOfConjunction() throws Exception { Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/DuplicateConjunction.owl")); ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkClass b = factory.getClass(new ElkFullIri("http://example.org/B")); TracingTestUtils.checkTracingCompleteness(a, b, reasoner); }
public void testFactory() { ElkClassExpression heart = objectFactory.getClass(new ElkFullIri("Heart")); ElkClassExpression organ = objectFactory.getClass(new ElkFullIri("Organ")); ElkClassExpression heart2 = objectFactory.getClass(new ElkFullIri("Heart")); assertSame("heart == heart2", heart, heart2); assertNotSame("heart != organ", organ); } }
@Test @SuppressWarnings("static-method") public void testBasicTracing() throws Exception { Reasoner reasoner = TestReasonerUtils .loadAndClassify(TestReasonerUtils.loadAxioms("tracing/DuplicateExistential.owl")); ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); ElkClass a = factory.getClass(new ElkFullIri("http://example.org/A")); ElkClass d = factory.getClass(new ElkFullIri("http://example.org/D")); TracingTestUtils.checkTracingCompleteness(a, d, reasoner); }