public FreshEntitiesException convert(ElkFreshEntitiesException e) { HashSet<OWLEntity> owlEntities = new HashSet<OWLEntity>(); for (ElkEntity elkEntity : e.getEntities()) { owlEntities.add(convert(elkEntity)); } return new FreshEntitiesException(owlEntities); }
/** * Helper method to get a {@link TaxonomyNode} from the taxonomy. * * @param elkClass * an {@link ElkClass} for which to find a {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkClass} * */ protected TaxonomyNode<ElkClass> getTaxonomyNode(ElkClass elkClass) throws ElkException { final Taxonomy<ElkClass> taxonomy = getTaxonomy(); final TaxonomyNode<ElkClass> node = taxonomy.getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTaxonomyNode<ElkClass>(elkClass, taxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
/** * Helper method to get an {@link InstanceNode} from the taxonomy. * * @param elkNamedIndividual * @return the {@link InstanceNode} for the given {@link ElkNamedIndividual} * @throws ElkException * if the result cannot be computed */ protected InstanceNode<ElkClass, ElkNamedIndividual> getInstanceNode( ElkNamedIndividual elkNamedIndividual) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final InstanceNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getInstanceNode(elkNamedIndividual); if (node != null) return node; // else if (allowFreshEntities) return new FreshInstanceNode<ElkClass, ElkNamedIndividual>( elkNamedIndividual, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkNamedIndividual); }
/** * Helper method to get a {@link TypeNode} from the taxonomy. * * @param elkClass * @return the {@link TypeNode} for the given {@link ElkClass} * @throws ElkException * if the result cannot be computed */ protected TypeNode<ElkClass, ElkNamedIndividual> getTypeNode( ElkClass elkClass) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final TypeNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTypeNode<ElkClass, ElkNamedIndividual>(elkClass, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
public FreshEntitiesException convert(ElkFreshEntitiesException e) { HashSet<OWLEntity> owlEntities = new HashSet<OWLEntity>(); for (ElkEntity elkEntity : e.getEntities()) { owlEntities.add(convert(elkEntity)); } return new FreshEntitiesException(owlEntities); }
/** * Helper method to get a {@link TaxonomyNode} from the taxonomy. * * @param elkClass * an {@link ElkClass} for which to find a {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkClass} * */ protected TaxonomyNode<ElkClass> getTaxonomyNode(ElkClass elkClass) throws ElkException { final Taxonomy<ElkClass> taxonomy = getTaxonomy(); final TaxonomyNode<ElkClass> node = taxonomy.getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTaxonomyNode<ElkClass>(elkClass, taxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
public FreshEntitiesException convert(ElkFreshEntitiesException e) { HashSet<OWLEntity> owlEntities = new HashSet<OWLEntity>(); for (ElkEntity elkEntity : e.getEntities()) { owlEntities.add(convert(elkEntity)); } return new FreshEntitiesException(owlEntities); }
/** * Helper method to get a {@link TaxonomyNode} from the taxonomy. * * @param elkClass * an {@link ElkClass} for which to find a {@link TaxonomyNode} * @return the {@link TaxonomyNode} for the given {@link ElkClass} * */ protected TaxonomyNode<ElkClass> getTaxonomyNode(ElkClass elkClass) throws ElkException { final Taxonomy<ElkClass> taxonomy = getTaxonomy(); final TaxonomyNode<ElkClass> node = taxonomy.getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTaxonomyNode<ElkClass>(elkClass, taxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
/** * Helper method to get a {@link TypeNode} from the taxonomy. * * @param elkClass * @return the {@link TypeNode} for the given {@link ElkClass} * @throws ElkException * if the result cannot be computed */ protected TypeNode<ElkClass, ElkNamedIndividual> getTypeNode( ElkClass elkClass) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final TypeNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTypeNode<ElkClass, ElkNamedIndividual>(elkClass, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
/** * 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 an {@link InstanceNode} from the taxonomy. * * @param elkNamedIndividual * @return the {@link InstanceNode} for the given {@link ElkNamedIndividual} * @throws ElkException * if the result cannot be computed */ protected InstanceNode<ElkClass, ElkNamedIndividual> getInstanceNode( ElkNamedIndividual elkNamedIndividual) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final InstanceNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getInstanceNode(elkNamedIndividual); if (node != null) return node; // else if (allowFreshEntities) return new FreshInstanceNode<ElkClass, ElkNamedIndividual>( elkNamedIndividual, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkNamedIndividual); }
/** * Helper method to get an {@link InstanceNode} from the taxonomy. * * @param elkNamedIndividual * @return the {@link InstanceNode} for the given {@link ElkNamedIndividual} * @throws ElkException * if the result cannot be computed */ protected InstanceNode<ElkClass, ElkNamedIndividual> getInstanceNode( ElkNamedIndividual elkNamedIndividual) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final InstanceNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getInstanceNode(elkNamedIndividual); if (node != null) return node; // else if (allowFreshEntities) return new FreshInstanceNode<ElkClass, ElkNamedIndividual>( elkNamedIndividual, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkNamedIndividual); }
/** * Helper method to get a {@link TypeNode} from the taxonomy. * * @param elkClass * @return the {@link TypeNode} for the given {@link ElkClass} * @throws ElkException * if the result cannot be computed */ protected TypeNode<ElkClass, ElkNamedIndividual> getTypeNode( ElkClass elkClass) throws ElkException { final InstanceTaxonomy<ElkClass, ElkNamedIndividual> instanceTaxonomy = getInstanceTaxonomy(); final TypeNode<ElkClass, ElkNamedIndividual> node = instanceTaxonomy .getNode(elkClass); if (node != null) return node; // else if (allowFreshEntities) return new FreshTypeNode<ElkClass, ElkNamedIndividual>(elkClass, instanceTaxonomy); // else throw new ElkFreshEntitiesException(elkClass); }
/** * 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); }