private static void testProperty(final String ontologyURI, final String propertyURI) { final OWLAPILoader loader = new OWLAPILoader(); final KnowledgeBase kb = loader.createKB(new String[] { ontologyURI }); final OWLEntity entity = OntologyUtils.findEntity(propertyURI, loader.allOntologies()); if (entity == null) throw new IllegalArgumentException("Property not found: " + propertyURI); if (!(entity instanceof OWLObjectProperty)) throw new IllegalArgumentException("Not an object property: " + propertyURI); if (!EntitySearcher.isTransitive((OWLObjectProperty) entity, loader.allOntologies())) throw new IllegalArgumentException("Not a transitive property: " + propertyURI); final ATermAppl p = ATermUtils.makeTermAppl(entity.getIRI().toString()); testDeprecatedTaxonomy(kb, p); }
private void extractModule() { final Set<OWLEntity> entities = new HashSet<>(); for (final String entityName : entityNames) { final OWLEntity entity = OntologyUtils.findEntity(entityName, loader.allOntologies()); if (entity == null) throw new OpenlletCmdException("Entity not found in ontology: " + entityName); entities.add(entity); } final Set<OWLAxiom> module = ModularityUtils.extractModule(loader.getOntology(), entities, moduleType); try { final OWLOntology moduleOnt = loader.getManager().createOntology(module); loader.getManager().saveOntology(moduleOnt, new RDFXMLDocumentFormat(), new SystemOutDocumentTarget()); } catch (final OWLException e) { throw new OpenError(e); } } }
if (unsatisfiable != null) _name1 = OntologyUtils.findEntity(unsatisfiable, _owlApiLoader.allOntologies()); if (names.length != 2) { throw new OpenlletCmdException("Invalid format for subclass option: " + subclass); } _name1 = OntologyUtils.findEntity(names[0], _owlApiLoader.allOntologies()); _name2 = OntologyUtils.findEntity(names[1], _owlApiLoader.allOntologies()); if (names.length != 2) { throw new OpenlletCmdException("Invalid format for instance option: " + instance); } _name1 = OntologyUtils.findEntity(names[0], _owlApiLoader.allOntologies()); _name2 = OntologyUtils.findEntity(names[1], _owlApiLoader.allOntologies()); if (names.length != 3) { throw new OpenlletCmdException("Invalid format for property-value option: " + optionValue); } _name1 = OntologyUtils.findEntity(names[0], _owlApiLoader.allOntologies()); _name2 = OntologyUtils.findEntity(names[1], _owlApiLoader.allOntologies()); if (_name2.isOWLObjectProperty()) _name3 = OntologyUtils.findEntity(names[2], _owlApiLoader.allOntologies()); if (_name3 == null)
final KnowledgeBase kb = loader.createKB(getInputFiles()); final OWLEntity entity = OntologyUtils.findEntity(_propertyName, loader.allOntologies()); throw new OpenlletCmdException("Not an object property: " + _propertyName); if (!EntitySearcher.isTransitive((OWLObjectProperty) entity, loader.allOntologies())) throw new OpenlletCmdException("Not a transitive property: " + _propertyName); final OWLEntity filterClass = OntologyUtils.findEntity(filterName, loader.allOntologies()); if (filterClass == null) throw new OpenlletCmdException("Filter class not found: " + filterName);