Search in sources :

Example 1 with RevisionManager

use of edu.stanford.bmir.protege.web.server.revision.RevisionManager in project webprotege by protegeproject.

the class ProjectDownloader method exportProjectRevision.

private void exportProjectRevision(@Nonnull String projectDisplayName, @Nonnull RevisionNumber revisionNumber, @Nonnull OutputStream outputStream, @Nonnull DownloadFormat format) throws IOException, OWLOntologyStorageException {
    RevisionManager revisionManager = project.getRevisionManager();
    OWLOntologyManager manager = revisionManager.getOntologyManagerForRevision(revisionNumber);
    OWLOntologyID rootOntologyId = project.getRootOntology().getOntologyID();
    Optional<OWLOntology> revisionRootOntology = getOntologyFromManager(manager, rootOntologyId);
    if (revisionRootOntology.isPresent()) {
        saveImportsClosureToStream(projectDisplayName, revisionRootOntology.get(), format, outputStream, revisionNumber);
    } else {
        // An error - no flipping ontology!
        logger.info("Project download failed because the root ontology could not be retrived from the manager.  Project: ", project.getProjectId());
        throw new RuntimeException("The ontology could not be downloaded from " + applicationName + ".  Please contact the administrator.");
    }
}
Also used : RevisionManager(edu.stanford.bmir.protege.web.server.revision.RevisionManager) OWLOntologyID(org.semanticweb.owlapi.model.OWLOntologyID) OWLOntology(org.semanticweb.owlapi.model.OWLOntology) OWLOntologyManager(org.semanticweb.owlapi.model.OWLOntologyManager)

Aggregations

RevisionManager (edu.stanford.bmir.protege.web.server.revision.RevisionManager)1 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)1 OWLOntologyID (org.semanticweb.owlapi.model.OWLOntologyID)1 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)1