Пример #1
0
/**
 * Performs RDF normalization on the given JSON-LD input.
 *
 * @param mixed $input the JSON-LD object to normalize.
 * @param assoc [$options] the options to use:
 *          [base] the base IRI to use.
 *          [format] the format if output is a string:
 *            'application/nquads' for N-Quads (default).
 *          [resolver(url)] the URL resolver to use.
 *
 * @return array the normalized output.
 */
function jsonld_normalize($input, $options = array())
{
    $p = new JsonLdProcessor();
    return $p->normalize($input, $options);
}
Пример #2
0
/**
 * Normalizes a JSON-LD object.
 *
 * @param input the JSON-LD object to normalize.
 *
 * @return the normalized JSON-LD object.
 */
function jsonld_normalize($input)
{
    $p = new JsonLdProcessor();
    return $p->normalize($input);
}