slash method

URIRef slash(
  1. String name
)

Adds attribute to form a concrete URIRef

Returns a new instance. For example: URIRef.fullUri('http://example.org').slash('donna').

Implementation

URIRef slash(String name) {
  // Check if there's any delimiter such as '/' or '#' in the end.
  if (name.startsWith('/') && value.endsWith('/')) {
    name = name.substring(1);
  } else if (!name.startsWith('/') &&
      !value.endsWith('/') &&
      !value.endsWith('#')) {
    name = '/' + name;
  }

  /// TODO: check if there's invalid char in name, may use uri parser as an
  /// alternative way for turtle.
  return URIRef.fullUri(value + name);
}