Resource
Purpose
A Resource describes data associated with another structure.
Resources may be used to define available resources or to reference a specific resource.
The Canonical Data Model defines the structure of a Resource but does not define the available Resource types.
Storage ownership is separate from application ownership. A service may own the object or document that refers to a Resource, while Storage owns the Resource bytes and canonical Resource metadata.
---
Structure
A Resource consists of:
id- Identifies the Resource.type- Classifies the Resource.content- Contains the data associated with the Resource.
The interpretation of content is determined by type.
When a Resource references stored bytes, content may be represented by retrieval information rather than embedded bytes. That retrieval information must not expose Storage's internal filesystem path or backing implementation.
A source document retrieved from an external system is preserved as a Resource — for example a text/html Resource carrying the source URI, with the bytes retained only when appropriate (see html.md). A retrievable reference is sufficient; Elonn does not take ownership of, or duplicate, externally hosted resource bytes.
Stored byte Resources additionally expose metadata:
length- The byte length of the Resource content.sha256- The SHA-256 digest of the Resource content.owner- The member or service that owns access to the Resource.created- The creation timestamp.modified- The metadata modification timestamp.
---
Characteristics
- Resources are independent.
- Resources may contain any valid data.
- Resources are immutable.
Resource immutability means a Resource identifier must not be reused for different content. Replacing content creates a new Resource. A service that owns a document, object, attachment, avatar, or other domain structure decides which Resource is current for that structure.
---
External pages and links
A link to an external page or another web resource is a Resource. Its content carries the
source URI, and a domain, title, or short description when available. Its type classifies
it — for example a website.document for a page that can be interpreted into canonical
content, or a website.link for a bare reference.
A URI is never a string on an Action, and never a loose field a consumer reads to decide what
to do. When an Object points at an external page, that page is a Resource on the Object — with
a Relationship to it only when there is a named association worth recording (see
relationship.md).
Preview presentation
A Runtime presents a Resource whose type or stored media type identifies it as an image (for
example a preview_resource on a drawing_surface Object, or a member's uploaded photo) as a
visual preview — a thumbnail or inline image — rather than a bare filename, download link, or
generic file icon. A Runtime decides this from the Resource's own declared type; it does not
infer image treatment from the owning Service, the parent Object's type, or the field name that
referenced the Resource.
Focusing a Resource
Following a link is focusing its Resource. Focusing a Resource is a platform operation: the
Service that owns the Resource, or World, decides what focusing produces.
- For a web page whose format has an interpreter, focusing runs the consuming Service's open
path — for example Find's find.open — which interprets the page into a canonical
document Object opened on Carry (see html.md). The source URI remains on the Resource
as provenance and for display.
- When no interpreter handles the format, focusing may be terminal: the Resource is presented
as a reference and nothing is opened.
A consumer does not parse a Resource's URI to decide what focusing does, does not open a URI
itself, and does not fabricate an Object or a Resource from a URI it found in content. It
presents the Resource — a web Runtime as a link, another Runtime as a focusable reference or
not at all — and submits the focus. World returns the result.