Files, import and export¶
A model is a file of RDF: TriG by default, or any of five other formats. la-gram does not save on its own; the File menu opens and saves, imports and exports an ArchiMate Exchange file, and exports the open diagram as a picture, to a file or to the clipboard. In the browser, a file opens from your computer and saves as a download. What is in the file, its graphs and its vocabulary, is in File formats and vocabulary.
The File menu¶
The File menu is in sections, each entry with its icon:
| Section | Entries |
|---|---|
| opening | New model, Open… (Ctrl+O), Import ArchiMate exchange…, Export ArchiMate exchange… (below) |
| saving | Save (Ctrl+S, TriG), Save as ▸ with each format, Git ▸ with Git storage's entries (Git) |
| the open view | Export view ▸: Save as SVG…, Save as PNG…, Copy as PNG, Copy as SVG |
| settings | Model settings…, Settings… |
A submenu (▸) opens when the pointer is over its entry, or on a click; with the keyboard, Right or Enter opens it at its first entry and Left or Esc closes it. On a Mac the keys are Cmd+O and Cmd+S (Keyboard and mouse).
- Open File, and point at Save as: the six formats, then Turtle without diagram geometry.
- Point at Export view: the open diagram to a file or to the clipboard.
Open¶
File › Open… opens a model file: .ttl, .trig, .jsonld, .nq, .nt or .rdf. It replaces the
open model, after asking (Unsaved changes), and says what it did: Opened
shop.ttl: 223 triples., with how many elements it laid out when the file had no geometry, and whether an
older vocabulary was migrated. The metamodels loaded are those the file declares
(arch:modelConformsToMetamodel): the others are unloaded, and those not loaded yet are loaded — an ArchiMate 3.2
model opened after an ArchiMate 4.0 one has 3.2's palette alone. Metamodels the file declares that could not be
loaded are named (Could not load: …). A file that declares none keeps the metamodels loaded. While a large file opens, a spinner says so (Opening shop.trig…); it shows only
when opening takes more than a moment. Importing an ArchiMate exchange file shows it too.
A file of RDF that is not a la-gram model is opened too: la-gram adopts its model resource, its membership and a view. When no view has diagram geometry, every element is placed on the first diagram with the relationships between them, laid out as Arrange view lays a diagram out, with the choices last made there; when that layout cannot be used, in a grid, and the message says why.
- Choose File › Open…, or press Ctrl+O.
- Choose shop.ttl, saved from this site. The diagram opens.
Save¶
File › Save, or Ctrl+S (Cmd+S on a Mac), saves the model as TriG, named after the model:
Acme-online-shop.trig. In the browser it is a download, where the browser saves them. Saved, the ● after
the model's name goes, and the title's •. TriG keeps the model in its graphs:
the model resource and its folders, its semantics — elements, relationships, views — the diagram geometry,
which a pipeline can drop on its own, and who changed what and when (Last changed),
as the Linked.Archi converters write them.
The example model, abridged:
@prefix arch: <https://meta.linked.archi/core#>.
@prefix arch-vis: <https://meta.linked.archi/core-vis#>.
@prefix am4: <https://meta.linked.archi/archimate4/onto#>.
@prefix am4mm: <https://meta.linked.archi/archimate4/metamodel#>.
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
@prefix m: <https://example.org/acme/shop/>.
@prefix mg: <https://example.org/acme/shop/graph/>.
mg:model {
m:model a arch:Model;
skos:prefLabel "Acme online shop"@en;
arch:modelConformsToMetamodel am4mm:ArchiMate4
}
mg:semantic {
m:web-shop a am4:ApplicationComponent;
skos:prefLabel "Web shop"@en;
am4:qualifiedRealization m:web-shop-realizes-online-ordering;
am4:realizes m:online-ordering;
arch:inModel m:model;
arch:inView m:view-service-realization.
}
mg:views {
m:link-card-payment-serves-web-shop a arch-vis:Link;
arch-vis:archRelationship m:card-payment-serves-web-shop;
arch-vis:source m:node-card-payment;
arch-vis:target m:node-web-shop;
arch-vis:view m:view-service-realization.
}
A field you are typing in when you press Ctrl+S is left first, so what it holds is saved too.
- Change the model, and press Ctrl+S.
Acme-online-shop.trigis in your downloads, and the title loses its •.
Save as¶
File › Save as ▸ saves in another format, the extension after each entry:
| Entry | File |
|---|---|
| Turtle | .ttl: one graph, the four together; arch:inModel on every concept keeps membership clear |
| TriG (graph per layer) | .trig, as Save writes it |
| JSON-LD | .jsonld, with the graphs |
| N-Quads | .nq, with the graphs |
| N-Triples | .nt |
| RDF/XML | .rdf |
| Turtle without diagram geometry | .no-geometry.ttl (below) |
Each opens again with File › Open….
- Choose File › Save as › N-Triples.
Acme-online-shop.nthas one statement a line:
<https://example.org/acme/shop/web-shop> <http://www.w3.org/2004/02/skos/core#prefLabel> "Web shop"@en .
Save without diagram geometry¶
File › Save as › Turtle without diagram geometry saves Turtle without the diagram geometry, the
arch-vis: nodes, links, bounds and routes: Acme-online-shop.no-geometry.ttl. The views stay, as views
with their members (arch:inView); only the coordinates go. It is the file to hand to a pipeline that
reasons over the architecture and has no use for layout. Opened again, its diagrams are laid out afresh:
Opened Acme-online-shop.no-geometry.ttl: 153 triples, 8 elements laid out.
- Choose File › Save as › Turtle without diagram geometry.
- Open the file in a text editor: no
arch-vis:ArchNode.
Import ArchiMate exchange¶
File › Import ArchiMate exchange… reads an ArchiMate Model Exchange File (.xml), the format every
ArchiMate tool writes, Archi, BiZZdesign and Sparx among them. It is a 3.x format, so it is read as
ArchiMate 3.2, which la-gram bundles for this, and replaces the open model after asking.
| In the exchange file | In la-gram |
|---|---|
| elements and relationships | ArchiMate 3.2 elements and relationships (an access's read or write kind, a directed association); a relationship type spelt with Relationship after it, ServingRelationship, as the type |
| names, documentation | names, definitions, each in its language: the first in each |
| properties of the model, its elements, relationships and views | custom properties, as the ArchiMate converter writes them: the same property in a file imported and the same file converted is one resource, and two of one name are two values |
| diagrams, their viewpoints | diagram views, with ArchiMate 3.2's viewpoint of the name the file gives (Application Cooperation); none for a name 3.2 does not have |
| nodes, nested ones | placements, nested |
| connections and their bendpoints | lines, through their bends, each end where the file's tool drew it (line ends) |
| styles | each placement's look: fill and line colours, line width, font |
| groups and notes, and the lines from them | groups, notes and lines from figures, a line's label what it says |
a reference to another view (a Label with a viewRef) |
a view reference to that view; a note when the file has no such view |
folders (<organizations>) |
the model's folders, nested, each element, relationship and view in its folder, as the ArchiMate converter writes them (folders) |
It says what it imported (Imported … elements, … relationships, … views, … folders., the folders when the file has them), and names the types it skipped (Skipped unknown types: …): types the ArchiMate 3.2 ontology does not define are reported, not invented.
Folders¶
Each folder of the file is a folder of the model, named by its label (the first, when it has several), in
the folder it is in. The model tree shows them under Views, Elements and Relationships, by what each
holds. They are written as archimate2linkedarchi writes them, so the same file imported and converted
holds the same folders, under the same names:
| In the exchange file | In la-gram |
|---|---|
| a folder Actors & Roles in Business | the folder folder/business--actors-roles in the model's namespace: its labels from the top folder down, in lower case, each run of anything but a–z and 0–9 a -, joined with -- |
| an element listed twice in one folder | listed once |
| an element listed in two folders | in both |
| two folders of one name side by side | one folder, holding what both hold |
| an item with no label | no folder: what is inside it is in none |
| an element of a type the ontology does not define | not imported, so in no folder |
For example, an Archi model exported with its folders imports with Business, Application, Relations and Views, each holding what it held in Archi. A label written only in another script, such as Cyrillic, adds nothing to the folder's IRI, so two such folders side by side are one folder.
- Choose File › Import ArchiMate exchange… and pick a file exported with its folders.
- In the model tree, click Folders: the file's folders are in Elements, Relationships and Views.
Line ends¶
An exchange file gives a line's bends, not where it meets its elements: the tool that wrote the file works that out when it draws. The import places each end by where the line's next point is, and keeps it with the line:
| Where the line's next point is | Where the line meets the element |
|---|---|
| beside the element, within its height | its facing side, level with the point: the line leaves straight across |
| above or below it, within its width | its facing side, in line with the point: the line leaves straight up or down |
| off a corner | that corner |
The next point is the bend next to that end. For a line with no bends, it is the middle of what the two elements share: two elements side by side are joined by one straight line through the middle of the height they share. A line between an element and another inside it has no ends placed, and runs from centre to centre.
For example, a line from Payments to Ledger with one bend below Payments and level with Ledger leaves Payments straight down to the bend, then runs straight across into Ledger's side.
A model converted with archimate2linkedarchi has its ends placed the same way, so the file opened either way
draws the same lines. At a cut or rounded corner, or on a round shape, the end is drawn where the line, kept in its
direction, meets the shape.
- Export the model from Archi in the Open Exchange format, as an
.xmlfile. - In la-gram, choose File › Import ArchiMate exchange…, and choose the
.xmlfile. - The model opens in ArchiMate 3.2, its diagrams as they were drawn, with their colours.
Export ArchiMate exchange¶
File › Export ArchiMate exchange… saves the model as an ArchiMate Model Exchange File, named after the model:
Acme-online-shop.xml. It is there for an ArchiMate 3.2 model, the version the format is written for; for
another model it is greyed out, and pointing at it says why: Only an ArchiMate 3.2 model can be exported in the
exchange format. In the browser the file is a download.
The file holds everything the import reads, so the import reads it back as the same model:
| In la-gram | In the exchange file |
|---|---|
| the model's names, definitions and custom properties | its <name>s, <documentation> and <properties> |
| elements and relationships | <element>s and <relationship>s: an access with its kind (accessType, Write too), a directed association with isDirected, junctions as AndJunction and OrJunction |
| names and definitions | a <name> and a <documentation> for each language |
| custom properties | <property> values, each naming a property definition: one for each property identifier, or for each name where a property has none |
| the model's folders | <organizations>, nested, each listing its folders, then what it holds in its order |
| diagram views, their viewpoints | <view>s, with the viewpoint's name in the format (Application Cooperation) |
| placements, groups, notes, view references | <node>s, nested as drawn, those that overlap in drawing order, in whole units |
| lines, a line from a note with what it says | <connection>s with their bends, not their ends |
| each placement's, figure's and line's look | its <style>: line and fill colours, opacity as a percentage, line width, font |
Each element, relationship, view, placement and line keeps its identifier, so a file imported and exported has
its own. One la-gram made is the end of its IRI, with id- first where that does not start as an XML identifier
must: id-3f2a9c…. What the format cannot hold is left out:
| Left out | Why |
|---|---|
| elements and relationships of types ArchiMate 3.2 does not have, and the relationships, placements and lines that need them | the format has no type for them |
| shapes, figures drawn as a core-vis shape | the format draws none |
| catalog and matrix views | the format has diagrams only |
| a viewpoint ArchiMate 3.2 does not have | the format names its own |
Other parts of a look — a gradient, text alignment, a picture, a relationship's name moved along its line, a look for one presentation — are not written. A view reference to a catalog or a matrix is written as a note with its text. A diagram drawn left of or above its origin is moved right and down, whole: the format's coordinates are not negative.
While a large model is written, a spinner says so (Exporting Shop…). It says what it exported, Exported 120 elements, 340 relationships and 12 views to shop.xml., and, when something was left out, what: Left out: 3 elements of types the exchange format does not have.
For example, a model imported from an Archi exchange file and exported again holds the same elements, relationships, folders and diagrams, under the identifiers Archi gave them.
- Open an ArchiMate 3.2 model, or import one with File › Import ArchiMate exchange….
- Choose File › Export ArchiMate exchange…:
Shop.xmlis saved, and la-gram says what it holds. - Choose File › Import ArchiMate exchange… and that file: the same model opens.
Export view as SVG or PNG¶
File › Export view › Save as SVG… and Save as PNG…, also Export view as SVG and Export view as PNG
in the empty canvas's right-click menu, save the open diagram as a picture, named after the view:
How-the-shop-serves-its-customers.svg.
| SVG | PNG | |
|---|---|---|
| what | the diagram, cropped to what is drawn | the same, as pixels |
| size | as drawn | twice as drawn, so it is sharp on a high-density screen, in a document or a slide; made smaller when it would be over 16 384 px a side or 120 million pixels |
| glyphs and pictures | in the file, so it shows them wherever it is opened | in the file |
| a picture its site does not let la-gram read (no CORS) | linked, and named in a message | left out, and named in a message |
Only a diagram exports: with a catalog or matrix open, la-gram says Open a diagram view to export it.
- Open "How the shop serves its customers".
- Choose File › Export view › Save as PNG….
How-the-shop-serves-its-customers.pngis saved, at twice the size drawn.
Copy view to the clipboard¶
File › Export view › Copy as PNG and Copy as SVG, also Copy view as PNG and Copy view as SVG in the empty canvas's right-click menu, put the open diagram on the clipboard, drawn as the export draws it, to paste straight into a document, a slide, a chat or a drawing. la-gram says Copied the view as PNG: paste it where you want it.
| Copy as PNG | Copy as SVG | |
|---|---|---|
| on the clipboard | a picture (image/png), twice as drawn |
the drawing as vector (image/svg+xml) where the browser writes it, and its SVG markup as text |
| pastes into | anything that takes a pasted picture: documents, slides, chats, image editors | drawing tools that read SVG; a text editor gets the markup |
| glyphs and pictures | in the picture; one la-gram cannot read is left out, and named | in the markup; one la-gram cannot read is linked, and named |
The browser asks nothing for this: the click is the permission. A browser that cannot put a picture on the clipboard says so (This browser cannot put a picture on the clipboard: export the view as PNG instead.). Only a diagram copies: with a catalog or matrix open, la-gram says Open a diagram view to copy it.
- Open "How the shop serves its customers", and right-click the empty canvas.
- Choose Copy view as PNG, then paste into a document: the diagram is there, as a picture.
Unsaved changes¶
File › New model, Open… and Import ArchiMate exchange… replace the open model. With changes not saved, each asks first, in Unsaved changes: The model has unsaved changes. Open another model anyway? Its button says what it will do: Start a new model, Open another model or Import; Cancel keeps the model. In a collaboration room, Shared model asks instead (Collaboration).
Closing the browser tab with changes not saved asks too, in the browser's own words. The desktop app asks in its own dialog (Desktop app).
- Change the model, then choose File › Open….
- Unsaved changes asks: choose Cancel, then File › Save, then File › Open… again.