A transform takes a value from an atom, a selector, or literal text and either alters it (substituting a new value in its place) or modifies its appearance in the viewer. The
[url] transforms return a result and so they change the atom's value. Together, these are known as bracketed transforms.
It is the responsibility of the viewer to act on the
[url]and that action should take place in the context of the viewer.
All transforms are rendered in the viewer rather than in the engine. They are recorded in the hybrid database and affect the returned results but they are only utilized by viewers. A
[filespec] in a transform represents a path on the machine running the viewer application. A
[url] transform is executed in the same network and security context as the viewer application. Neither kind of transforms contains references to files or URLs in Nebula worlds or streams.
Transforms can affect values in three possible ways:
When a transform occurs without a provided value (literal text, an embedded atom, the output of a format, etc.), the
filespec text is the return value.
(@WHITEPAPER Mimix Whitepaper :pdf [https://mimix.io/wp-content/uploads/2018/08/On-Mimix-v1.3.pdf]) ⇒ https://mimix.io/wp-content/uploads/2018/08/On-Mimix-v1.3.pdf (@ATOMIUM Atomium :img [file:///usr/images/atomium-belgium.dng]) ⇒ file:///usr/images/atomium-belgium.dng
When a value is provided before a transform, that value alone is the return value. Both the provided value and the transform are included in the return MSL.
(@QED-BOOK Quantum Electron Dynamics [file:///usr/qed-book-draft.md]) ⇒ (@QED-BOOK Quantum Electron Dynamics [file:///usr/qed-book-draft.md]) ⇒ Quantum Electron Dynamics
When multiple transforms appear in sequence, the first transform's
filespec text is returned if a value is not provided. All the transforms are returned in order in the return MSL.
(@DONALD Donald Duck :img [file:///usr/donald.png] [file:///usr/donald.jpg]) ⇒ (@DONALD Donald Duck :img [file:///usr/donald.png] [file:///usr/donald.jpg]) ⇒ Donald Duck (@DONALD:img) ⇒ (@DONALD Donald Duck :img [file:///usr/donald.png] [file:///usr/donald.jpg]) ⇒ file:///usr/donald.png
When tranformed documents contain textual information, they can be recast to MSL text and their evolving contents stored in the hybrid database. Recasting is performed by the viewer and achieved by rewriting the transform as a fully-provided value with the original transform following.
(msl recast-merchant Recast The Merchant of Venice as MSL) (@merchant The Merchant of Venice :author William Shakespeare :text [http://www.gutenberg.org/cache/epub/1114/pg1114.txt]) (@merchant :author William Shakespeare :text (@SCENE-1 SCENE: (@Venice Venice), and (@PORTIA PORTIA)'S house at (@Belmont Belmont) ...) [http://www.gutenberg.org/cache/epub/1114/pg1114.txt]) (@merchant:text) ⇒ SCENE: Venice and PORTIA'S house at Belmont ...
The plain text found at the
url in line 3 was recast by the viewer in line 5, with the
(@merchant:text) metadata now containing the individual atoms identified by the viewer.
In all cases, bracketed transforms are specified in URL format, with the URI filespec denoting files on local or network drives. Viewer applications that allow browsing or bulk processing of these local drives and are responsible for converting local paths to URI filespecs before including them inside a transform.
Viewers should also convert URI filespecs back to local paths in order to compare or update those sources from files, directories, or drives on the local machine. In this way, each viewer is only responsible for processing one kind of transformation: local paths on the viewer's same platform to URI filespecs and back.
When an MSL application needs to move files between machines (via a separate websocket wire, for example), or a file is retrieved from an online source, the transform can be rewritten as a valid
[url] value on the receiving machine.
(s english-class English Class (@merchant-of-venice The Merchant of Venice [http://www.gutenberg.org/cache/epub/1114/pg1114.txt])) (s english-class English Class (c english-class-canon English Class Canon (@merchant-of-venice The Merchant of Venice [file:///usr/the-merchant-of-venice.txt])))
In line 5, the online document that was transformed in line 2 is canonized and replaced with a local file transform, moving its reference to the local machine.