public function getMetadata(): Resource {
        $graph = new Graph();
        $res   = $graph->resource('.');

        $res->addResource(RC::idProp(), $this->getId());
        $res->addResource(self::$seeAlsoProp, $this->getId());

        $classes = RC::get('redmineClasses');
        $res->addResource('rdf:type', $classes[get_called_class()]);

        foreach (self::$propMap as $redmineProp => $rdfProp) {
            $value = null;
            if (isset($this->data[$redmineProp])) {
                $value = $this->data[$redmineProp];
            } elseif (isset($this->data['custom_fields'])) {
                foreach ($this->data['custom_fields'] as $cf) {
                    if ($cf->name === $redmineProp && isset($cf->value)) {
                        $value = $cf->value;
                    }
                }
            }
            if (is_object($value)) {
                $value = $value->id;
            }
            if ($value !== null) {
                if (!is_array($value)) {
                    $value = [$value];
                }
                foreach ($value as $v) {
                    try {
                        $this->addValue($res, $rdfProp, $v);
                    } catch (RuntimeException $e) {
                        echo "\n" . 'Adding value for the ' . $redmineProp . ' of the ' . $this->data['id'] . ' failed: ' . $e->getMessage() . "\n";
                        throw $e;
                    }
                }
            }
        }
        return $res;
    }