private function matchAggregate(
        Identity $identity,
        object $entity,
        Query $query
    ): Query {
        $meta = ($this->metadata)(\get_class($entity));
        $name = $this->name->sprintf(\md5($identity->value()));
        $this->variables = $this->variables->add((string) $name);

        $query = $query
            ->match(
                (string) $name,
                $meta->labels()->toPrimitive()
            )
            ->withProperty(
                $meta->identity()->property(),
                (string) $name
                    ->prepend('{')
                    ->append('_identity}')
            )
            ->withParameter(
                (string) $name->append('_identity'),
                $identity->value()
            );

        return $meta
            ->children()
            ->reduce(
                $query,
                function(Query $carry, string $property, Child $child) use ($name): Query {
                    $carry = $carry
                        ->match((string) $name)
                        ->linkedTo(
                            $childName = (string) $name
                                ->append('_')
                                ->append($child->relationship()->property())
                                ->append('_')
                                ->append($child->relationship()->childProperty()),
                            $child->labels()->toPrimitive()
                        )
                        ->through(
                            (string) $child->relationship()->type(),
                            $relName = (string) $name
                                ->append('_')
                                ->append($child->relationship()->property())
                        );
                    $this->variables = $this->variables
                        ->add($childName)
                        ->add($relName);

                    return $carry;
                }
            );
    }