def ToURN(self):
    """Converts a reference into an URN."""

    if self.path_type in [PathInfo.PathType.OS, PathInfo.PathType.TSK]:
      return rdfvalue.RDFURN(self.client_id).Add("fs").Add(
          self.path_type.name.lower()).Add("/".join(self.path_components))
    elif self.path_type == PathInfo.PathType.REGISTRY:
      return rdfvalue.RDFURN(self.client_id).Add("registry").Add("/".join(
          self.path_components))
    elif self.path_type == PathInfo.PathType.TEMP:
      return rdfvalue.RDFURN(self.client_id).Add("temp").Add("/".join(
          self.path_components))

    raise ValueError("Unsupported path type: %s" % self.path_type)
Converts a reference into an URN.