code: public static Stream<Outcome> decode(final Stream<Statement> stream,
              @Nullable final Boolean chunked) {
          Preconditions.checkNotNull(stream);
          return Record.decode(stream, ImmutableSet.of(KSR.INVOCATION), chunked).transform(
                  new Function<Record, Outcome>() {
  
                      @Override
                      public Outcome apply(final Record record) {
                          return Outcome.create(record);
                      }
  
                  }, 0);
      }
docs: Performs RDF-to-outcome decoding by converting a stream of RDF statements in a stream of
  outcomes. Parameter {@code chunked} specifies whether the input statement stream is
  chunked, i.e., organized as a sequence of statement chunks with each chunk containing the
  statements for an outcome. Chunked RDF streams noticeably speed up decoding, and are always
  produced by the KnowledgeStore API. Chunking information may be set to null (e.g., because
  unknown at the time the method is called): in this case, it will be read from metadata
  attribute {@code "chunked"} attached to the stream; reading will happen just before
  decoding will take place, i.e., when a terminal stream operation will be called.
  
  @param stream
  the stream of statements to decode
  @param chunked
  true if the input statement stream is chunked, null if to be read from stream
  metadata
  @return the resulting stream of outcomes