code: public ResponseBuilder getRepresentation(final Resource res) {
          final String identifier = getBaseUrl() + req.getPartition() + req.getPath();
  
          // Check if this is already deleted
          checkDeleted(res, identifier);
  
          LOGGER.debug("Acceptable media types: {}", req.getHeaders().getAcceptableMediaTypes());
          final Optional<RDFSyntax> syntax = getSyntax(req.getHeaders().getAcceptableMediaTypes(), res.getBinary()
                  .map(b -> b.getMimeType().orElse(APPLICATION_OCTET_STREAM)));
  
          if (ACL.equals(req.getExt()) && !res.hasAcl()) {
              throw new NotFoundException();
          }
  
          final ResponseBuilder builder = basicGetResponseBuilder(res, syntax);
  
          // Add NonRDFSource-related "describe*" link headers
          res.getBinary().ifPresent(ds -> {
              if (syntax.isPresent()) {
                  builder.link(identifier + "#description", "canonical").link(identifier, "describes");
              } else {
                  builder.link(identifier, "canonical").link(identifier + "#description", "describedby")
                      .type(ds.getMimeType().orElse(APPLICATION_OCTET_STREAM));
              }
          });
  
          // Only show memento links for the user-managed graph (not ACL)
          if (!ACL.equals(req.getExt())) {
              builder.link(identifier, "original timegate")
                  .links(MementoResource.getMementoLinks(identifier, res.getMementos()).toArray(Link[]::new));
          }
  
          // URI Template
          builder.header(LINK_TEMPLATE, "<" + identifier + "{?version}>; rel=\"" + Memento.Memento.getIRIString() + "\"");
  
          // NonRDFSources responses (strong ETags, etc)
          if (res.getBinary().isPresent() && !syntax.isPresent()) {
              return getLdpNr(identifier, res, builder);
          }
  
          // RDFSource responses (weak ETags, etc)
          final RDFSyntax s = syntax.orElse(TURTLE);
          final IRI profile = getProfile(req.getHeaders().getAcceptableMediaTypes(), s);
          return getLdpRs(identifier, res, builder, s, profile);
      }
docs: Build the representation for the given resource
  @param res the resource
  @return the response builder