private Taxonomy<ElkObjectProperty> loadAndClassifyObjectProperties(String resource) throws IOException, Owl2ParseException, ElkInconsistentOntologyException, ElkException { Reasoner reasoner = TestReasonerUtils.createTestReasoner( getClass().getClassLoader().getResourceAsStream(resource), 1); return reasoner.getObjectPropertyTaxonomy(); }
@Override public Taxonomy<ElkObjectProperty> getTaxonomy(final String resource) throws ElkException { final Reasoner reasoner = TestReasonerUtils.createTestReasoner( getClass().getClassLoader().getResourceAsStream(resource), 1); return reasoner.getObjectPropertyTaxonomy(); } @Override
/** * Helper method to get a {@link TaxonomyNode} from the property taxonomy. * * @param elkProperty * an {@link ElkObjectProperty} for which to find a * {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkObjectProperty} * */ protected TaxonomyNode<ElkObjectProperty> getObjectPropertyTaxonomyNode( final ElkObjectProperty elkProperty) throws ElkException { final Taxonomy<ElkObjectProperty> propertyTaxonomy = getObjectPropertyTaxonomy(); final TaxonomyNode<ElkObjectProperty> node = propertyTaxonomy .getNode(elkProperty); if (node != null) { return node; } // else if (allowFreshEntities) { return new FreshTaxonomyNode<ElkObjectProperty>(elkProperty, propertyTaxonomy); } // else throw new ElkFreshEntitiesException(elkProperty); }
/** * Helper method to get a {@link TaxonomyNode} from the property taxonomy. * * @param elkProperty * an {@link ElkObjectProperty} for which to find a * {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkObjectProperty} * */ protected TaxonomyNode<ElkObjectProperty> getObjectPropertyTaxonomyNode( final ElkObjectProperty elkProperty) throws ElkException { final Taxonomy<ElkObjectProperty> propertyTaxonomy = getObjectPropertyTaxonomy(); final TaxonomyNode<ElkObjectProperty> node = propertyTaxonomy .getNode(elkProperty); if (node != null) { return node; } // else if (allowFreshEntities) { return new FreshTaxonomyNode<ElkObjectProperty>(elkProperty, propertyTaxonomy); } // else throw new ElkFreshEntitiesException(elkProperty); }
/** * Helper method to get a {@link TaxonomyNode} from the property taxonomy. * * @param elkProperty * an {@link ElkObjectProperty} for which to find a * {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkObjectProperty} * */ protected TaxonomyNode<ElkObjectProperty> getObjectPropertyTaxonomyNode( final ElkObjectProperty elkProperty) throws ElkException { final Taxonomy<ElkObjectProperty> propertyTaxonomy = getObjectPropertyTaxonomy(); final TaxonomyNode<ElkObjectProperty> node = propertyTaxonomy .getNode(elkProperty); if (node != null) { return node; } // else if (allowFreshEntities) { return new FreshTaxonomyNode<ElkObjectProperty>(elkProperty, propertyTaxonomy); } // else throw new ElkFreshEntitiesException(elkProperty); }
@Override public void precomputeInferences(InferenceType... inferenceTypes) throws ReasonerInterruptedException, TimeOutException, InconsistentOntologyException { LOGGER_.trace("precomputeInferences(InferenceType...)"); checkInterrupted(); // we use the main progress monitor only here this.reasoner_.setProgressMonitor(this.mainProgressMonitor_); try { for (InferenceType inferenceType : inferenceTypes) { if (inferenceType.equals(InferenceType.CLASS_HIERARCHY)) reasoner_.getTaxonomy(); else if (inferenceType.equals(InferenceType.CLASS_ASSERTIONS)) reasoner_.getInstanceTaxonomy(); else if (inferenceType .equals(InferenceType.OBJECT_PROPERTY_HIERARCHY)) { reasoner_.getObjectPropertyTaxonomy(); } } } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "precomputeInferences(inferenceTypes)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } finally { this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); } }
@Override public void precomputeInferences(InferenceType... inferenceTypes) throws ReasonerInterruptedException, TimeOutException, InconsistentOntologyException { LOGGER_.trace("precomputeInferences(InferenceType...)"); checkInterrupted(); // we use the main progress monitor only here this.reasoner_.setProgressMonitor(this.mainProgressMonitor_); try { for (InferenceType inferenceType : inferenceTypes) { if (inferenceType.equals(InferenceType.CLASS_HIERARCHY)) reasoner_.getTaxonomy(); else if (inferenceType.equals(InferenceType.CLASS_ASSERTIONS)) reasoner_.getInstanceTaxonomy(); else if (inferenceType .equals(InferenceType.OBJECT_PROPERTY_HIERARCHY)) { reasoner_.getObjectPropertyTaxonomy(); } } } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "precomputeInferences(inferenceTypes)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } finally { this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); } }
@Override public void precomputeInferences(InferenceType... inferenceTypes) throws ReasonerInterruptedException, TimeOutException, InconsistentOntologyException { LOGGER_.trace("precomputeInferences(InferenceType...)"); checkInterrupted(); // we use the main progress monitor only here this.reasoner_.setProgressMonitor(this.mainProgressMonitor_); try { for (InferenceType inferenceType : inferenceTypes) { if (inferenceType.equals(InferenceType.CLASS_HIERARCHY)) reasoner_.getTaxonomy(); else if (inferenceType.equals(InferenceType.CLASS_ASSERTIONS)) reasoner_.getInstanceTaxonomy(); else if (inferenceType .equals(InferenceType.OBJECT_PROPERTY_HIERARCHY)) { reasoner_.getObjectPropertyTaxonomy(); } } } catch (ElkUnsupportedReasoningTaskException e) { throw unsupportedOwlApiMethod( "precomputeInferences(inferenceTypes)", e.getMessage()); } catch (ElkException e) { throw elkConverter_.convert(e); } catch (ElkRuntimeException e) { throw elkConverter_.convert(e); } finally { this.reasoner_.setProgressMonitor(this.secondaryProgressMonitor_); } }