roboto.uri
The roboto:// URI scheme, a host-independent reference to one platform entity.
roboto://<type>/<id> names an entity without naming a web address. Platform event payloads, AI chat answers, and notifications all identify entities this way; opening one in the Roboto web app lands on that entity’s page. A URI may carry a ?t= epoch nanosecond timestamp, which asks a time-aware page to open at that instant, and a ?v= version, which names one version of a versioned entity such as a file.
Module Contents
ROBOTO_URI_IN_TEXT_PATTERN
Finds where a roboto:// URI starts and ends inside prose, for callers rewriting URIs into links. Deliberately looser than RobotoUri.parse(): it matches text this module refuses to parse, because a finder that skipped a malformed URI would leave it in the rendered output as raw text.
ROBOTO_URI_SCHEME
RobotoUri
A parsed roboto://<type>/<id> reference, optionally carrying a timestamp and a version.
str() renders it back to URI text in normalized form: the type is lowercased, empty path segments are dropped, and only the t and v query parameters survive, in that order, so str(RobotoUri.parse(text)) equals text only when text is already normalized.
Raises
ValueErrorid is empty, timestamp_ns is negative, or version is below 1.
Attributes
RobotoUri.id
RobotoUri.parse()
Read roboto://<type>/<id>, with optional t=<epoch_ns> and v=<version> parameters, into its parts.
Query parameters other than t and v are ignored and the entity type is matched case-insensitively, so a URI written by any Roboto surface parses here.
Parameters
text strThe URI to read. Anything else raises rather than returning None, so a caller sifting arbitrary prose should locate candidates with ROBOTO_URI_IN_TEXT_PATTERN first.
Raises
ValueErrortext is not a roboto:// URI, names a type outside RobotoUriType, carries no entity id or more than one path segment, carries a t that is not a whole number of nanoseconds, or carries a v that is not a whole number.
Return type
Attributes
RobotoUri.timestamp_ns
The instant this URI points at, in nanoseconds since the Unix epoch, written as the URI’s ?t= parameter. None when the URI names an entity and no instant. Only pages showing data over time act on it; the rest ignore it.
RobotoUri.type
RobotoUri.version
The version of the entity this URI points at, written as the URI’s ?v= parameter. None when the URI names the entity without pinning a version. A file link carries one, so it keeps resolving to the version it was made against.
RobotoUriType
Bases: roboto.compat.StrEnum
The entity kinds a roboto:// URI may name.
A roboto:// URI whose type is absent from this enum names no entity. The web app relies on that to reserve type names for links addressing its own controls rather than an entity, so an unrecognized type is ordinary input, not corruption.
Attributes
RobotoUriType.Collection
RobotoUriType.Dataset
RobotoUriType.Device
RobotoUriType.Event
RobotoUriType.File
RobotoUriType.Invocation
RobotoUriType.Layout
RobotoUriType.MessagePath
RobotoUriType.Org
RobotoUriType.Session
RobotoUriType.Topic
RobotoUriType.Trigger
RobotoUriType.Workspace
TIMESTAMP_QUERY_PARAM
Query parameter naming the instant a URI points at, in epoch nanoseconds.
VERSION_QUERY_PARAM
Query parameter naming one version of the entity a URI points at.