def link(self, obj, name='', default=None, app=SAME_APP):
        if obj is None:
            return default

        if app is None:
            raise LinkError("Cannot link: app is None")

        if app is SAME_APP:
            app = self.app

        info = app._get_deferred_mounted_path(obj)

        if info is None:
            raise LinkError("Cannot link to: %r" % obj)

        return info.url(self.link_prefix(), name)
This pulls apart the salient bits of the URI and populates the
dataset/ETHPy150Open morepath/morepath/morepath/request.py/Request.link--crossover with--dataset/ETHPy150Open toastdriven/piecrust/piecrust/resources.py/Resource.get_via_uri