private function storeValue(NodePath $nodePath, array $data, string $property, $value) : array
    {
        $nodePath = $nodePath->popFirst($nodeName);
        $nodeName = $this->encodeNodeName($nodeName);
        if (!isset($data[$nodeName])) {
            $data[$nodeName] = [];
        }
        if ($nodePath->isEmpty()) {
            // we arrived at the target, check if the value is not set already
            if (!empty($data[$nodeName][$property]) && ($data[$nodeName][$property] != $value)) {
                throw new InconsistentValueException("Attempting to overwrite '$property' value '"
                    . $data[$nodeName][$property] . "' with '$value'.");
            }
            $data[$nodeName][$property] = $value;
        } else {
            $data[$nodeName] = $this->storeValue($nodePath, $data[$nodeName], $property, $value);
        }
        return $data;
    }