out.println("<body>");
out.println("<b>" +OntVersion.getFullTitle()+ "</b><br/><br/>");
out.println(" Full requested URI: <code>" + fullRequestedUri + "</code> <br/><br/>");
// parse the given URI:
MmiUri mmiUri;
try {
mmiUri = new MmiUri(fullRequestedUri);
}
catch (URISyntaxException e) {
out.println("<font color=\"red\">ERROR: " +e.getReason()+ "</font><br/>");
out.println("</body>");
out.println("</html>");
return;
}
String ontologyUri = mmiUri.getOntologyUri();
// show the parse result:
String authority = mmiUri.getAuthority();
String topic = mmiUri.getTopic();
String version = mmiUri.getVersion();
String term = mmiUri.getTerm();
out.println("Parse result: OK<br/>");
out.println("<pre>");
out.println(" Ontology URI: " + ontologyUri);
out.println(" authority: " + authority);
out.println(" version: " + (version != null ? version : "(not given)"));
out.println(" topic: " + topic);
out.println(" Term: " + term);
out.println("</pre>");
// report something about the available versions:
out.println("Available versions:");
out.println("<pre>");
for ( OntologyInfo ont : db.getOntologyVersions(mmiUri) ) {
out.println(" " +ont.getUri());
}
out.println("</pre>");
// obtain info about the ontology:
String[] foundUri = { null };
OntologyInfo ontology = db.getOntologyWithExts(mmiUri, foundUri);
out.println("<br/>Database result:<br/> ");
if ( ontology != null ) {
out.println(foundUri[0]+ ": <font color=\"green\">Found.</font> <br/>");
}
else {
out.println(ontologyUri+ ": <font color=\"red\">Not found.</font> <br/>");
out.println("</body>");
out.println("</html>");
return;
}
// prepare info about the path to the file on disk:
File file = OntServlet.getFullPath(ontology, ontConfig, log);
// report the db info and whether the file can be read or not:
out.println(" Ontology entry FOUND: <br/>");
out.println("<pre>");
out.println(" id: " + ontology.getId());
out.println(" ontology_id: " + ontology.getOntologyId());
out.println(" file_path: " + ontology.getFilePath());
out.println(" filename: " + ontology.getFilename());
out.println("</pre>");
out.println(" Full path: <code>" + file.getAbsolutePath() + "</code> ");
out.println(" Can read it: <code>" + file.canRead() + "</code> <br/>");
if ( file.canRead() ) {
out.println("<br/>");
String uriFile = file.toURI().toString();
Model model = JenaUtil2.loadModel(uriFile, false);
if ( mmiUri.getTerm().length() > 0 ) {
_showTermInfo(mmiUri, model, out);
}
else {
_showAllTerms(mmiUri, model, out, true);
}