Search in sources :

Example 1 with ManchesterOWLSyntaxFrameRenderer

use of org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterOWLSyntaxFrameRenderer in project webprotege by protegeproject.

the class GetManchesterSyntaxFrameActionHandler method execute.

@Nonnull
@Override
public GetManchesterSyntaxFrameResult execute(@Nonnull GetManchesterSyntaxFrameAction action, @Nonnull ExecutionContext executionContext) {
    StringWriter writer = new StringWriter();
    EscapingShortFormProvider entityShortFormProvider = new EscapingShortFormProvider(shortFormProvider);
    final ManchesterOWLSyntaxFrameRenderer frameRenderer = new ManchesterOWLSyntaxFrameRenderer(importsClosure.getImportsClosure(), writer, entityShortFormProvider);
    frameRenderer.setOntologyIRIShortFormProvider(ontologyIRIShortFormProvider);
    frameRenderer.setRenderExtensions(true);
    // frameRenderer.setRenderOntologyLists(true);
    // frameRenderer.setUseTabbing(true);
    // frameRenderer.setUseWrapping(true);
    frameRenderer.writeFrame(action.getSubject());
    // frameRenderer.writeRulesContainingPredicate(action.getSubject());
    return new GetManchesterSyntaxFrameResult(writer.getBuffer().toString());
}
Also used : EscapingShortFormProvider(edu.stanford.bmir.protege.web.server.shortform.EscapingShortFormProvider) StringWriter(java.io.StringWriter) ManchesterOWLSyntaxFrameRenderer(org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterOWLSyntaxFrameRenderer) GetManchesterSyntaxFrameResult(edu.stanford.bmir.protege.web.shared.frame.GetManchesterSyntaxFrameResult) Nonnull(javax.annotation.Nonnull)

Aggregations

EscapingShortFormProvider (edu.stanford.bmir.protege.web.server.shortform.EscapingShortFormProvider)1 GetManchesterSyntaxFrameResult (edu.stanford.bmir.protege.web.shared.frame.GetManchesterSyntaxFrameResult)1 StringWriter (java.io.StringWriter)1 Nonnull (javax.annotation.Nonnull)1 ManchesterOWLSyntaxFrameRenderer (org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterOWLSyntaxFrameRenderer)1