tasks/jsonld/js/jsonld.js
function _labelBlankNodes(namer, element) {
  if(_isArray(element)) {
    for(var i = 0; i < element.length; ++i) {
      element[i] = _labelBlankNodes(namer, element[i]);
    }
  }
  else if(_isList(element)) {
    element['@list'] = _labelBlankNodes(namer, element['@list']);
  }
  else if(_isObject(element)) {
    // rename blank node
    if(_isBlankNode(element)) {
      element['@id'] = namer.getName(element['@id']);
    }

    // recursively apply to all keys
    var keys = Object.keys(element).sort();
    for(var ki = 0; ki < keys.length; ++ki) {
      var key = keys[ki];
      if(key !== '@id') {
        element[key] = _labelBlankNodes(namer, element[key]);
      }
    }
  }

  return element;
}
function _labelBlankNodes(namer, element) {
  if(_isArray(element)) {
    for(var i = 0; i < element.length; ++i) {
      element[i] = _labelBlankNodes(namer, element[i]);
    }
  }
  else if(_isList(element)) {
    element['@list'] = _labelBlankNodes(namer, element['@list']);
  }
  else if(_isObject(element)) {
    // rename blank node
    if(_isBlankNode(element)) {
      element['@id'] = namer.getName(element['@id']);
    }

    // recursively apply to all keys
    var keys = Object.keys(element).sort();
    for(var ki = 0; ki < keys.length; ++ki) {
      var key = keys[ki];
      if(key !== '@id') {
        element[key] = _labelBlankNodes(namer, element[key]);
      }
    }
  }

  return element;
}
function _labelBlankNodes ( namer , element ) { if ( _isArray ( element ) ) { for ( var i = 0 ; i < element . length ; ++ i ) { element [ i ] = _labelBlankNodes ( namer , element [ i ] ) ; } } else if ( _isList ( element ) ) { element [ '@list' ] = _labelBlankNodes ( namer , element [ '@list' ] ) ; } else if ( _isObject ( element ) ) { // rename blank node if ( _isBlankNode ( element ) ) { element [ '@id' ] = namer . getName ( element [ '@id' ] ) ; } // recursively apply to all keys var keys = Object . keys ( element ) . sort ( ) ; for ( var ki = 0 ; ki < keys . length ; ++ ki ) { var key = keys [ ki ] ; if ( key !== '@id' ) { element [ key ] = _labelBlankNodes ( namer , element [ key ] ) ; } } } return element ; }
Labels the blank nodes in the given value using the given UniqueNamer.

@param namer the UniqueNamer to use.
@param element the element with blank nodes to rename.

@return the element.
Labels the blank nodes in the given value using the given UniqueNamer .