OntologyScope scope;
OntologyInputSource<?,?> coreSrc = null, custSrc = null;
// First thing, check the core source.
if (coreRegistry != null && !coreRegistry.isEmpty()) try {
coreSrc = new LibrarySource(IRI.create(coreRegistry.replace("%23", "#")), regMgr);
} catch (Exception e1) {
throw new WebApplicationException(e1, BAD_REQUEST);
// Bad or not supplied core registry, try the ontology.
}
else if (coreOntology != null && !coreOntology.isEmpty()) try {
coreSrc = new RootOntologyIRISource(IRI.create(coreOntology));
} catch (Exception e2) {
// If this fails too, throw a bad request.
throw new WebApplicationException(e2, BAD_REQUEST);
}
// Don't bother if no custom was supplied at all...
if (customRegistry != null && !customRegistry.isEmpty())
// ...but if it was, be prepared to throw exceptions.
try {
coreSrc = new LibrarySource(IRI.create(customRegistry.replace("%23", "#")), regMgr);
} catch (Exception e1) {
throw new WebApplicationException(e1, BAD_REQUEST);
// Bad or not supplied custom registry, try the ontology.
}
if (customOntology != null && !customOntology.isEmpty()) try {