public ExternalOntologyInfo getExternalOntologyInfo(String ontologyUri) {
log.debug("getExternalOntologyInfo: ontologyUri=" +ontologyUri);
ExternalOntologyInfo oi = new ExternalOntologyInfo();
oi.setUri(ontologyUri);
oi.setDisplayLabel(ontologyUri);
String error = null;
Exception ex = null;
try {
// 298: Load of external ontology for mapping does not use content negotiation
// first load the model with this new supporting routine:
OntModel ontModel = OntInfoUtil.loadExternalModel(ontologyUri);
OntInfoUtil.getEntities(oi, ontModel);
}
catch (FileNotFoundException e) {
error = "File not found: '" +ontologyUri+ "'";
}
catch (UnknownHostException e) {
error = "Unknown host: '" +ontologyUri+ "'";
}
catch (Exception e) {
ex = e;
error = e.getClass().getName() + ": " + e.getMessage();
}
if (log.isDebugEnabled() && ex != null) {
log.debug("Error getting ExternalOntologyInfo: " +ontologyUri, ex);
}
oi.setError(error);
return oi;
}