public function getAclMetadata(): Resource {
        $meta = (new Graph())->resource($this->uri ? $this->uri : '.');
        $meta->addType('http://www.w3.org/ns/auth/acl#Authorization');
        $meta->addLiteral(RC::titleProp(), 'Fedora WebAC rule');
        foreach ($this->resources as $i) {
            $meta->addResource('http://www.w3.org/ns/auth/acl#accessTo', $i->getUri(true));
        }
        foreach ($this->classes as $i) {
            $meta->addResource('http://www.w3.org/ns/auth/acl#accessToClass', $i);
        }
        foreach ($this->roles[self::USER] as $i) {
            if (preg_match('|^https?://.+|', $i)) {
                $meta->addResource('http://www.w3.org/ns/auth/acl#agent', $i);
            } else {
                $meta->addLiteral('http://www.w3.org/ns/auth/acl#agent', $i);
            }
        }
        foreach ($this->roles[self::GROUP] as $i) {
            if (preg_match('|^https?://.+|', $i)) {
                $meta->addResource('http://www.w3.org/ns/auth/acl#agentClass', $i);
            } else {
                $meta->addLiteral('http://www.w3.org/ns/auth/acl#agentClass', $i);
            }
        }
        if ($this->mode == self::WRITE) {
            $meta->addResource('http://www.w3.org/ns/auth/acl#mode', 'http://www.w3.org/ns/auth/acl#Write');
        }
        if ($this->mode >= self::READ) {
            $meta->addResource('http://www.w3.org/ns/auth/acl#mode', 'http://www.w3.org/ns/auth/acl#Read');
        }
        return $meta;
    }