Returns the canonical key for the given ``key``.

def canonical_key(self, key):
        """Returns the canonical key for the given ``key``."""
        if key.startswith('/'):
            return urlparse.urljoin(self.base_uri, key)
        else:
            return self.curies.expand(key)