@Override
    public ValidationResult validate(Document doc) {
        ValidationResult validationResult =
                new ValidationResult(new ArrayList<String>(),
                        new ArrayList<String>());

        // note: this doesn't call validate(statement) for performance reasons

        // XXX verify(doc) *must* be invoked prior to semantic check to ensure
        // namespace index is open.
        try {
            nsService.verify(doc);
        } catch (SymbolWarning e) {
            for (ResourceSyntaxWarning rsw : e.getResourceSyntaxWarnings()) {
                validationResult.getWarnings().add(rsw.getUserFacingMessage());
            }
        } catch (ResourceDownloadError rde) {
            validationResult.getErrors().add(rde.getUserFacingMessage());
        } catch (IndexingFailure idxf) {
            validationResult.getErrors().add(idxf.getUserFacingMessage());
        }

        List<SemanticWarning> semanticWarnings = semanticCheck(doc.getAllTerms());
        semanticWarnings.addAll(semanticCheck(doc.getAllStatements()));
        for (SemanticWarning sw : semanticWarnings) {
            validationResult.getWarnings().add(sw.getUserFacingMessage());
        }

        try {
            annoService.verify(doc);
        } catch (SymbolWarning sw) {
            for (ResourceSyntaxWarning rsw : sw.getResourceSyntaxWarnings()) {
                validationResult.getWarnings().add(rsw.getUserFacingMessage());
            }
        }

        return validationResult;
    }
@ Override public ValidationResult validate ( Document doc ) { ValidationResult validationResult = new ValidationResult ( new ArrayList < String > ( ) , new ArrayList < String > ( ) ) ; try { nsService . verify ( doc ) ; } catch ( SymbolWarning e ) { for ( ResourceSyntaxWarning rsw : e . getResourceSyntaxWarnings ( ) ) { validationResult . getWarnings ( ) . add ( rsw . getUserFacingMessage ( ) ) ; } } catch ( ResourceDownloadError rde ) { validationResult . getErrors ( ) . add ( rde . getUserFacingMessage ( ) ) ; } catch ( IndexingFailure idxf ) { validationResult . getErrors ( ) . add ( idxf . getUserFacingMessage ( ) ) ; } List < SemanticWarning > semanticWarnings = semanticCheck ( doc . getAllTerms ( ) ) ; semanticWarnings . addAll ( semanticCheck ( doc . getAllStatements ( ) ) ) ; for ( SemanticWarning sw : semanticWarnings ) { validationResult . getWarnings ( ) . add ( sw . getUserFacingMessage ( ) ) ; } try { annoService . verify ( doc ) ; } catch ( SymbolWarning sw ) { for ( ResourceSyntaxWarning rsw : sw . getResourceSyntaxWarnings ( ) ) { validationResult . getWarnings ( ) . add ( rsw . getUserFacingMessage ( ) ) ; } } return validationResult ; }
{@inheritDoc}