Reasoner createReasoner(ElkObject.Factory elkFactory, AxiomLoader.Factory axiomLoaderFactory, final ReasonerInterrupter interrupter, ReasonerStageExecutor stageExecutor, ReasonerConfiguration config) { final Reasoner reasoner = createReasoner(elkFactory, interrupter, stageExecutor, config); reasoner.registerAxiomLoader(axiomLoaderFactory); return reasoner; }
Reasoner createReasoner(ElkObject.Factory elkFactory, AxiomLoader.Factory axiomLoaderFactory, final ReasonerInterrupter interrupter, ReasonerStageExecutor stageExecutor, ReasonerConfiguration config) { final Reasoner reasoner = createReasoner(elkFactory, interrupter, stageExecutor, config); reasoner.registerAxiomLoader(axiomLoaderFactory); return reasoner; }
Reasoner createReasoner(ElkObject.Factory elkFactory, AxiomLoader.Factory axiomLoaderFactory, final ReasonerInterrupter interrupter, ReasonerStageExecutor stageExecutor, ReasonerConfiguration config) { final Reasoner reasoner = createReasoner(elkFactory, interrupter, stageExecutor, config); reasoner.registerAxiomLoader(axiomLoaderFactory); return reasoner; }
private void initReasoner(final Reasoner reasoner) { this.reasoner_ = reasoner; this.reasoner_.registerAxiomLoader(new OwlOntologyLoader.Factory( owlOntology_, this.mainProgressMonitor_)); this.reasoner_.setAllowFreshEntities(isAllowFreshEntities); // use the secondary progress monitor by default, when necessary, we // switch to the primary progress monitor; this is to avoid bugs with // progress monitors in Protege this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); }
private void initReasoner(final Reasoner reasoner) { this.reasoner_ = reasoner; this.reasoner_.registerAxiomLoader(new OwlOntologyLoader.Factory( owlOntology_, this.mainProgressMonitor_)); this.reasoner_.setAllowFreshEntities(isAllowFreshEntities); // use the secondary progress monitor by default, when necessary, we // switch to the primary progress monitor; this is to avoid bugs with // progress monitors in Protege this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); }
private void initReasoner(final Reasoner reasoner) { this.reasoner_ = reasoner; this.reasoner_.registerAxiomLoader(new OwlOntologyLoader.Factory( owlOntology_, this.mainProgressMonitor_)); this.reasoner_.setAllowFreshEntities(isAllowFreshEntities); // use the secondary progress monitor by default, when necessary, we // switch to the primary progress monitor; this is to avoid bugs with // progress monitors in Protege this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); }
@Override public void applyChanges(final Iterable<ElkAxiom> changes, final IncrementalChangeType type) { standardReasoner_.registerAxiomLoader(new TestAxiomLoaderFactory( new TestChangesLoader(changes, type))); incrementalReasoner_.registerAxiomLoader(new TestAxiomLoaderFactory( new TestChangesLoader(changes, type))); }
@Override public void loadChanges(final Reasoner reasoner, final IncrementalChange<ElkAxiom> change) { reasoner.registerAxiomLoader( new TestAxiomLoaderFactory(new TestChangesLoader( change.getAdditions(), change.getDeletions()))); }
@Override public void revertChanges(Reasoner reasoner, IncrementalChange<ElkAxiom> change) { reasoner.registerAxiomLoader( new TestAxiomLoaderFactory(new TestChangesLoader( change.getDeletions(), change.getAdditions()))); }
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));
@Test public void testNewClassUnsatisfiable() throws ElkException { TestChangesLoader loader = new TestChangesLoader(); Reasoner reasoner = TestReasonerUtils.createTestReasoner(loader); reasoner.setAllowIncrementalMode(false); ElkClass a = createElkClass("A"); ElkClass b = createElkClass("B"); loader.add(objectFactory.getSubClassOfAxiom(a, b)); LOGGER_.trace("********************* Initial taxonomy computation *********************"); Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomy(); assertTrue(taxonomy.getNode(a).getDirectSuperNodes() .contains(taxonomy.getNode(b))); reasoner.setAllowIncrementalMode(true); TestChangesLoader changeLoader = new TestChangesLoader(); reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader)); ElkClass c = createElkClass("C"); ElkClass d = createElkClass("D"); changeLoader.add( objectFactory.getDisjointClassesAxiom(Arrays.asList(c, d, c))); LOGGER_.trace("********** Taxonomy re-computation after incremental change ************"); taxonomy = reasoner.getTaxonomy(); assertSame(taxonomy.getBottomNode(), taxonomy.getNode(c)); assertNotSame(taxonomy.getBottomNode(), taxonomy.getNode(d)); }
@Test public void testPropositionalAdditions() throws ElkException { TestChangesLoader loader = new TestChangesLoader(); Reasoner reasoner = TestReasonerUtils.createTestReasoner(loader); reasoner.setAllowIncrementalMode(false); ElkClass a = createElkClass("A"); ElkClass b = createElkClass("B"); ElkClass c = createElkClass("C"); ElkClass d = createElkClass("D"); loader.add(objectFactory.getSubClassOfAxiom(a, c)) .add(objectFactory.getSubClassOfAxiom(c, d)); LOGGER_.trace("********************* Initial taxonomy computation *********************"); Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomy(); reasoner.setAllowIncrementalMode(true); TestChangesLoader changeLoader = new TestChangesLoader(); reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader)); changeLoader.add(objectFactory.getSubClassOfAxiom(a, b)) .add(objectFactory.getSubClassOfAxiom(b, d)); LOGGER_.trace("********* Taxonomy re-computation after incremental additions **********"); taxonomy = reasoner.getTaxonomy(); assertTrue(taxonomy.getNode(a).getDirectSuperNodes() .contains(taxonomy.getNode(c))); assertTrue(taxonomy.getNode(a).getDirectSuperNodes() .contains(taxonomy.getNode(b))); }
@Test public void testEquivalences() throws ElkException { TestChangesLoader loader = new TestChangesLoader(); Reasoner reasoner = TestReasonerUtils.createTestReasoner(loader, 1); reasoner.setAllowIncrementalMode(false); ElkClass x = createElkClass("X"); ElkClass y = createElkClass("Y"); ElkAxiom axXsubY = objectFactory.getSubClassOfAxiom(x, y); ElkAxiom axYsubX = objectFactory.getSubClassOfAxiom(y, x); loader.add(axXsubY); LOGGER_.trace("********************* Initial taxonomy computation *********************"); Taxonomy<ElkClass> taxonomy = reasoner.getTaxonomy(); // node for X = [X] assertEquals(1, taxonomy.getNode(x).size()); reasoner.setAllowIncrementalMode(true); TestChangesLoader changeLoader = new TestChangesLoader(); reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader)); LOGGER_.trace("********* Taxonomy re-computation after incremental additions **********"); changeLoader.add(axYsubX); taxonomy = reasoner.getTaxonomy(); // node for X = [X,Y] assertEquals(2, taxonomy.getNode(y).size()); }
@Test public void testAddingFreshTrivialProperty() throws Exception { final ElkObject.Factory factory = new ElkObjectEntityRecyclingFactory(); final ElkClass a = factory .getClass(new ElkFullIri("http://example.org/A")); final ElkClass b = factory .getClass(new ElkFullIri("http://example.org/B")); final ElkClass c = factory .getClass(new ElkFullIri("http://example.org/C")); final ElkClass d = factory .getClass(new ElkFullIri("http://example.org/D")); final ElkObjectProperty r = factory .getObjectProperty(new ElkFullIri("http://example.org/R")); final Set<ElkAxiom> initial = new HashSet<ElkAxiom>(); initial.add(factory.getSubClassOfAxiom(b, c)); final Reasoner reasoner = TestReasonerUtils.loadAndClassify(initial); reasoner.setAllowIncrementalMode(true); final TestChangesLoader loader = new TestChangesLoader(); loader.add(factory.getSubClassOfAxiom(a, factory.getObjectSomeValuesFrom(r, b))); loader.add(factory .getSubClassOfAxiom(factory.getObjectSomeValuesFrom(r, c), d)); reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(loader)); TracingTestUtils.checkTracingCompleteness(a, d, reasoner); }
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader)); changeLoader.remove(posExistential);
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));
reasoner.registerAxiomLoader(new TestAxiomLoaderFactory(changeLoader));