code: public static String getRelativeRef(String ref) {
          Matcher matcher = match(ref);
          return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null;
      }
docs: Create a relative ref url from the specified ref
  
  @param ref the ref url to be made relative
  
  @return the relative ref url or null if the specified ref was not valid