Search in sources :

Example 1 with ComputeProjectMergeResult

use of edu.stanford.bmir.protege.web.shared.merge.ComputeProjectMergeResult in project webprotege by protegeproject.

the class ComputeProjectMergeActionHandler method execute.

@Nonnull
@Override
public ComputeProjectMergeResult execute(@Nonnull ComputeProjectMergeAction action, @Nonnull ExecutionContext executionContext) {
    try {
        DocumentId documentId = action.getProjectDocumentId();
        OWLOntology uploadedRootOntology = loadUploadedOntology(documentId);
        Set<OntologyDiff> diffs = computeDiff(uploadedRootOntology, projectRootOntology);
        List<DiffElement<String, SafeHtml>> transformedDiff = renderDiff(uploadedRootOntology, diffs);
        return new ComputeProjectMergeResult(transformedDiff);
    } catch (Exception e) {
        logger.info("An error occurred whilst merging ontologies", e);
        throw new RuntimeException(e);
    }
}
Also used : DiffElement(edu.stanford.bmir.protege.web.shared.diff.DiffElement) ComputeProjectMergeResult(edu.stanford.bmir.protege.web.shared.merge.ComputeProjectMergeResult) DocumentId(edu.stanford.bmir.protege.web.shared.csv.DocumentId) OntologyDiff(edu.stanford.bmir.protege.web.shared.merge.OntologyDiff) IOException(java.io.IOException) Nonnull(javax.annotation.Nonnull)

Aggregations

DocumentId (edu.stanford.bmir.protege.web.shared.csv.DocumentId)1 DiffElement (edu.stanford.bmir.protege.web.shared.diff.DiffElement)1 ComputeProjectMergeResult (edu.stanford.bmir.protege.web.shared.merge.ComputeProjectMergeResult)1 OntologyDiff (edu.stanford.bmir.protege.web.shared.merge.OntologyDiff)1 IOException (java.io.IOException)1 Nonnull (javax.annotation.Nonnull)1