@Override public void interrupt() { _kb.getTimers().interrupt(); }
@Override public void interrupt() { _kb.getTimers().interrupt(); }
@Override public long getTimeOut() { return _kb.getTimers()._mainTimer.getTimeout(); }
@Override public long getTimeOut() { return _kb.getTimers()._mainTimer.getTimeout(); }
@Override public long getTimeOut() { return _kb.getTimers()._mainTimer.getTimeout(); }
@Override public void interrupt() { _kb.getTimers().interrupt(); }
public CompletionStrategy(final ABox abox) { _abox = abox; _tbox = abox.getTBox(); _timers = abox.getKB().getTimers(); _completionTimer = _timers.getTimer("complete"); }
public CompletionStrategy(final ABox abox) { _abox = abox; _tbox = abox.getTBox(); _timers = abox.getKB().getTimers(); _completionTimer = _timers.getTimer("complete"); }
public boolean isDirectlyBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("dBlocking"); try { return isDirectlyBlockedInt(blocked); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isDirectlyBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("dBlocking"); try { return isDirectlyBlockedInt(blocked); } finally { timer.ifPresent(t -> t.stop()); } }
public void load(final Set<OWLOntology> ontologies) { final Optional<Timer> timer = _kb.getTimers().startTimer("load"); final Collection<OWLOntology> toBeLoaded = new LinkedHashSet<>(); for (final OWLOntology ontology : ontologies) load(ontology, false, toBeLoaded); _visitor.reset(); _visitor.setAddAxiom(true); for (final OWLOntology ontology : toBeLoaded) ontology.accept(_visitor); _visitor.verify(); timer.ifPresent(t -> t.stop()); }
public void load(final Set<OWLOntology> ontologies) { final Optional<Timer> timer = _kb.getTimers().startTimer("load"); final Collection<OWLOntology> toBeLoaded = new LinkedHashSet<>(); for (final OWLOntology ontology : ontologies) load(ontology, false, toBeLoaded); _visitor.reset(); _visitor.setAddAxiom(true); for (final OWLOntology ontology : toBeLoaded) ontology.accept(_visitor); _visitor.verify(); timer.ifPresent(t -> t.stop()); }
public void load(final Set<OWLOntology> ontologies) { final Optional<Timer> timer = _kb.getTimers().startTimer("load"); final Collection<OWLOntology> toBeLoaded = new LinkedHashSet<>(); for (final OWLOntology ontology : ontologies) load(ontology, false, toBeLoaded); _visitor.reset(); _visitor.setAddAxiom(true); for (final OWLOntology ontology : toBeLoaded) ontology.accept(_visitor); _visitor.verify(); timer.ifPresent(t -> t.stop()); }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
public boolean isBlocked(final Individual blocked) { final Optional<Timer> timer = blocked.getABox().getKB().getTimers().startTimer("blocking"); try { return !blocked.isRoot() && (isIndirectlyBlocked(blocked) || isDirectlyBlockedInt(blocked)); } finally { timer.ifPresent(t -> t.stop()); } }
private boolean realizeByConcepts() { if (null == _classes) // This occur only on concurrent environment that involve read / write / classification at same time; a correct handling require to create a state-less KnowledgeBase. classify(); _monitor.setProgressLength(_classes.size() + 2); _monitor.taskStarted(); clearMarks(); final Collection<ATermAppl> individuals = _kb.getIndividuals(); if (!individuals.isEmpty()) realizeByConcept(ATermUtils.TOP, individuals); _kb.getTimers().getTimer("realize").ifPresent(t -> t.check()); if (_monitor.isCanceled()) return false; _monitor.taskFinished(); return true; }
public InterruptReasoningExample() { // create the Jena model model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC); openllet = (PelletInfGraph) model.getGraph(); // get the underlying openllet timers timers = openllet.getKB().getTimers(); // set the timeout for main reasoning tasks timers.createTimer("complete").setTimeout(Timeouts.CONSISTENCY); timers.createTimer("classify").setTimeout(Timeouts.CLASSIFY); timers.createTimer("realize").setTimeout(Timeouts.REALIZE); }
public InterruptReasoningExample() { // create the Jena model model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC); openllet = (PelletInfGraph) model.getGraph(); // get the underlying openllet timers timers = openllet.getKB().getTimers(); // set the timeout for main reasoning tasks timers.createTimer("complete").setTimeout(Timeouts.CONSISTENCY); timers.createTimer("classify").setTimeout(Timeouts.CLASSIFY); timers.createTimer("realize").setTimeout(Timeouts.REALIZE); }
@Test public void testDayCare() { final String ns = "https://mywebspace.wisc.edu/jpthielman/web/daycareontology#"; final OntModel ontModel = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, null); ontModel.read(_base + "daycare.swrl.owl"); ontModel.prepare(); final Property exposedTo = ontModel.getProperty(ns + "is_exposed_to"); for (final Resource ind : ontModel.listIndividuals(OWL.Thing).toList()) System.out.println(ind.toString() + ": " + ontModel.getProperty(ind, exposedTo)); ((PelletInfGraph) ontModel.getGraph()).getKB().getTimers().print(); ontModel.close(); }
@Test public void testBasicFamily() { final String ns = "http://www.csc.liv.ac.uk/~luigi/ontologies/basicFamily#"; final OntModel ontModel = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC, null); ontModel.read(_base + "basicFamilyReference.owl"); ontModel.read(_base + "basicFamilyRules.owl"); ontModel.prepare(); final Property uncle = ontModel.getProperty(ns + "hasUncle"); for (final Resource ind : ontModel.listIndividuals(OWL.Thing).toList()) System.out.println(ind.toString() + ": " + ontModel.getProperty(ind, uncle)); ((PelletInfGraph) ontModel.getGraph()).getKB().getTimers().print(); ontModel.close(); }