コード例 #1
0
ファイル: jsonld.php プロジェクト: nickl-/php-json-ld
        return $rval;
    }
    /**
     * Returns true if the given value is an absolute IRI, false if not.
     *
     * @param string $v the value to check.
     *
     * @return bool true if the value is an absolute IRI, false if not.
     */
    protected static function _isAbsoluteIri($v)
    {
        return strpos($v, ':') !== false;
    }
}
// register the N-Quads RDF parser
jsonld_register_rdf_parser('application/nquads', 'JsonLdProcessor::parseNQuads');
/**
 * A JSON-LD Exception.
 */
class JsonLdException extends Exception
{
    protected $type;
    protected $details;
    protected $cause;
    public function __construct($msg, $type, $details = null, $previous = null)
    {
        $this->type = $type;
        $this->details = $details;
        $this->cause = $previous;
        parent::__construct($msg, 0, $previous);
    }
コード例 #2
0
     * @param stdClass $o2 the second object.
     * @param string key the key to check.
     *
     * @return bool true if both objects have the same value for the key or
     *   neither has the key.
     */
    protected static function _compareKeyValues($o1, $o2, $key)
    {
        if (property_exists($o1, $key)) {
            return property_exists($o2, $key) && $o1->{$key} === $o2->{$key};
        }
        return !property_exists($o2, $key);
    }
}
// register the N-Quads RDF parser
jsonld_register_rdf_parser('application/nquads', array('JsonLdProcessor', 'parseNQuads'));
/**
 * A JSON-LD Exception.
 */
class JsonLdException extends Exception
{
    protected $type;
    protected $details;
    protected $cause;
    public function __construct($msg, $type, $details = null, $previous = null)
    {
        $this->type = $type;
        $this->details = $details;
        $this->cause = $previous;
        parent::__construct($msg, 0, $previous);
    }