public static int findURISplitIndex(String uri){
  int uriLength=uri.length();
  int idx=uriLength - 1;
  for (; idx >= 0; idx--) {
    if (!TurtleUtil.isNameChar(uri.charAt(idx))) {
      break;
    }
  }
  idx++;
  for (; idx < uriLength; idx++) {
    if (TurtleUtil.isNameStartChar(uri.charAt(idx))) {
      break;
    }
  }
  if (!TurtleUtil.isNameEndChar(uri.charAt(uriLength - 1))) {
    return -1;
  }
  if (idx > 0 && idx < uriLength) {
    return idx;
  }
  return -1;
}

public static int findURISplitIndex ( String uri ) { int uriLength = uri . length ( ) ; int idx = uriLength - 1 ; for ( ; idx >= 0 ; idx -- ) { if ( ! TurtleUtil . isNameChar ( uri . charAt ( idx ) ) ) { break ; } } idx ++ ; for ( ; idx < uriLength ; idx ++ ) { if ( TurtleUtil . isNameStartChar ( uri . charAt ( idx ) ) ) { break ; } } if ( ! TurtleUtil . isNameEndChar ( uri . charAt ( uriLength - 1 ) ) ) { return - 1 ; } if ( idx > 0 && idx < uriLength ) { return idx ; } return - 1 ; }
tries to find an index where the supplied uri can be split into a namespace and a local name that comply with the serialization constraints of the turtle format .
