public String render(OWLEntity entity) {
    String shortForm = getProvider().getShortForm(entity);
    final String uriStr = entity.getIRI().toString();

    for (Map.Entry<String, String> prefixName2PrefixEntry :
        prefixManager.getPrefixName2PrefixMap().entrySet()) {
      String prefixName = prefixName2PrefixEntry.getKey();
      if (!shortForm.startsWith(prefixName)) {
        String prefix = prefixName2PrefixEntry.getValue();
        if (uriStr.startsWith(prefix)) {
          if (!prefixName.equals(":")) {
            return escape(prefixName + shortForm);
          } else {
            return escape(shortForm);
          }
        }
      } else {
        return escape(shortForm);
      }
    }
    return entity.getIRI().toQuotedString();
  }