jsonLdGraph = collect($parsedJson['@graph']); } public function filter(string $selector): Collection { return $this->jsonLdGraph->filter(static function ($schema) use ($selector): bool { return array_key_exists('@type', $schema) && $schema['@type'] === $selector; }); } }