code: @Override
      public void stage4SemanticVerification(final Document doc)
              throws SemanticFailure, IndexingFailure {
  
          // Linked lists are favored here to avoid array resizes
          final Set<Term> allDocTerms = doc.getAllTerms();
          final List<Statement> allDocStmts = doc.getAllStatements();
  
          List<SemanticWarning> failures = semanticCheck(allDocTerms);
          failures.addAll(semanticCheck(allDocStmts, doc));
  
          final int failureCount = failures.size();
          if (failureCount == 0) return;
          final StringBuilder bldr = new StringBuilder();
          bldr.append(failureCount);
          bldr.append(" semantic warning");
          if (failureCount > 1) bldr.append("s");
          bldr.append(" for document");
          throw new SemanticFailure(null, bldr.toString(), failures);
      }
docs: {@inheritDoc}