public function processContext($active_ctx, $local_ctx, $options) {
    global $jsonld_default_load_document;
    self::setdefaults($options, array(
      'base' => '',
      'documentLoader' => $jsonld_default_load_document));

    // return initial context early for null context
    if($local_ctx === null) {
      return $this->_getInitialContext($options);
    }

    // retrieve URLs in local_ctx
    $local_ctx = self::copy($local_ctx);
    if(is_string($local_ctx) or (
      is_object($local_ctx) && !property_exists($local_ctx, '@context'))) {
      $local_ctx = (object)array('@context' => $local_ctx);
    }
    try {
      $this->_retrieveContextUrls(
        $local_ctx, new stdClass(),
        $options['documentLoader'], $options['base']);
    } catch(Exception $e) {
      throw new JsonLdException(
        'Could not process JSON-LD context.',
        'jsonld.ContextError', null, null, $e);
    }

    // process context
    return $this->_processContext($active_ctx, $local_ctx, $options);
  }
public function processContext($active_ctx, $local_ctx, $options) {
    global $jsonld_default_load_document;
    self::setdefaults($options, array(
      'base' => '',
      'documentLoader' => $jsonld_default_load_document));

    // return initial context early for null context
    if($local_ctx === null) {
      return $this->_getInitialContext($options);
    }

    // retrieve URLs in local_ctx
    $local_ctx = self::copy($local_ctx);
    if(is_string($local_ctx) or (
      is_object($local_ctx) && !property_exists($local_ctx, '@context'))) {
      $local_ctx = (object)array('@context' => $local_ctx);
    }
    try {
      $this->_retrieveContextUrls(
        $local_ctx, new stdClass(),
        $options['documentLoader'], $options['base']);
    } catch(Exception $e) {
      throw new JsonLdException(
        'Could not process JSON-LD context.',
        'jsonld.ContextError', null, null, $e);
    }

    // process context
    return $this->_processContext($active_ctx, $local_ctx, $options);
  }
public function processContext ( $ active_ctx , $ local_ctx , $ options ) { global $ jsonld_default_load_document ; self :: setdefaults ( $ options , array ( 'base' => '' , 'documentLoader' => $ jsonld_default_load_document ) ) ; // return initial context early for null context if ( $ local_ctx === null ) { return $ this -> _getInitialContext ( $ options ) ; } // retrieve URLs in local_ctx $ local_ctx = self :: copy ( $ local_ctx ) ; if ( is_string ( $ local_ctx ) or ( is_object ( $ local_ctx ) && ! property_exists ( $ local_ctx , '@context' ) ) ) { $ local_ctx = ( object ) array ( '@context' => $ local_ctx ) ; } try { $ this -> _retrieveContextUrls ( $ local_ctx , new stdClass ( ) , $ options [ 'documentLoader' ] , $ options [ 'base' ] ) ; } catch ( Exception $ e ) { throw new JsonLdException ( 'Could not process JSON-LD context.' , 'jsonld.ContextError' , null , null , $ e ) ; } // process context return $ this -> _processContext ( $ active_ctx , $ local_ctx , $ options ) ; }
Processes a local context, resolving any URLs as necessary, and returns a
new active context in its callback.

@param stdClass $active_ctx the current active context.
@param mixed $local_ctx the local context to process.
@param assoc $options the options to use:
[documentLoader(url)] the document loader.

@return stdClass the new active context.
Processes a local context resolving any URLs as necessary and returns a new active context in its callback .