addPrefixToCtx method

void addPrefixToCtx(
  1. String prefixName,
  2. URIRef uriRef
)

Adds a prefix to context using its string forms

Overwrites the previous prefix name if it already exists in context

Implementation

void addPrefixToCtx(String prefixName, URIRef uriRef) {
  // Append ':' in the end for consistency and serialization as all keys in
  // [ctx] ends with ':' (except for 'BASE' key).
  if (!prefixName.endsWith(':')) {
    prefixName += ':';
  }
  ctx[prefixName] = uriRef;
}