Milliner/src/Service/MillinerService.php
protected function getFirstPredicate(array $jsonld, $predicate, $value = true)
    {
        $key = $value ? '@value' : '@id';
        $malformed = empty($jsonld) ||
            !isset($jsonld[0][$predicate]) ||
            empty($jsonld[0][$predicate]) ||
            !isset($jsonld[0][$predicate][0][$key]);

        if ($malformed) {
            return null;
        }

        return $jsonld[0][$predicate][0][$key];
    }
protected function getFirstPredicate(array $jsonld, $predicate, $value = true)
    {
        $key = $value ? '@value' : '@id';
        $malformed = empty($jsonld) ||
            !isset($jsonld[0][$predicate]) ||
            empty($jsonld[0][$predicate]) ||
            !isset($jsonld[0][$predicate][0][$key]);

        if ($malformed) {
            return null;
        }

        return $jsonld[0][$predicate][0][$key];
    }
protected function getFirstPredicate ( array $ jsonld , $ predicate , $ value = true ) { $ key = $ value ? '@value' : '@id' ; $ malformed = empty ( $ jsonld ) || ! isset ( $ jsonld [ 0 ] [ $ predicate ] ) || empty ( $ jsonld [ 0 ] [ $ predicate ] ) || ! isset ( $ jsonld [ 0 ] [ $ predicate ] [ 0 ] [ $ key ] ) ; if ( $ malformed ) { return null ; } return $ jsonld [ 0 ] [ $ predicate ] [ 0 ] [ $ key ] ; }
Gets the first value for a predicate in a JSONLD array.

@param $jsonld
@param $predicate
@param $value

@return mixed string|null
Gets the first value for a predicate in a JSONLD array .