Skip to content

Validation

la-gram checks the model against the loaded metamodels all the time, in the background: editing never waits for it. The Validation tab, under the canvas, lists what it finds, and its badge counts the violations. Violations are marked on the canvas too.

The Validation tab for the example's diagram: Model checks and Advice… beside its title, 1 warning(s), 2 info(s), and the button 1 more in the model; under Warnings, Gift wrapping, a Service, is not realized by anything, from ServiceWithoutRealizationShape, with Switch off… beside it; under Info, Web shop, an Application Component, is deployed on only one node or device, Shop server.
The example's findings: the planted warning on "Gift wrapping", and the first of two Info findings in the view.

Scope

Findings of, at the right of the tab's header, chooses whose findings are listed:

Scope Lists
View (the default) the open view's: the view itself, the concepts it presents, and its diagram
Model the whole model's

The choice is remembered in this browser. With View chosen and findings elsewhere in the model, a button after the summary says how many more there are (… more in the model), and switches to Model. With no view open, View cannot be chosen.

  1. Open the example model, and the Validation tab.
  2. Findings of is View: the summary reads "✗ 1 warning(s), 2 info(s)", and the button after it 1 more in the model: the finding on "Hosting", which no view presents.
  3. Choose Model in Findings of to see the whole model's: "✗ 1 warning(s), 3 info(s)".

Findings

Findings are grouped by severity: Violations, Warnings and Info, each folding, with its count. The summary above them counts each (✗ 1 warning(s), 2 info(s)), or says ✓ View conforms. Each finding shows:

  • what it is about, by name and type: "Gift wrapping", Service;
  • the message: Service Gift wrapping is not realized by anything.;
  • the property it is about, when there is one (Property: View conforms to viewpoint);
  • the shape it comes from, Shape: ServiceWithoutRealizationShape, a link to the shape on the metamodel's documentation, or for a model check, Check: and the question;
  • for advice, Switch off…: the shape's switch, in Settings.

Click a finding (or press Enter on it) to show the concept: it is selected, on the canvas when the view shows it. Click the shape's name to open its documentation in a new tab.

The example has one finding planted on purpose, and three that its "Shop server" brings: the one node both components run on, and the only provider of "Hosting". Neither is in a view; Model lists all four:

Severity About Message Shape
Warning Gift wrapping (Service) Service Gift wrapping is not realized by anything. ServiceWithoutRealizationShape
Info Payments (Application Component) Application component Payments is deployed on only one node or device (Shop server). Consider multi-node deployment for resilience. CriticalNodeSingleDeploymentShape
Info Web shop (Application Component) Application component Web shop is deployed on only one node or device (Shop server). Consider multi-node deployment for resilience. CriticalNodeSingleDeploymentShape
Info Hosting (Service) Service Hosting is provided by only one technology element (Shop server). Consider redundancy for critical infrastructure services. SinglePointOfFailureShape
  1. Click the "Gift wrapping" finding: "Gift wrapping" is selected on the diagram.
  2. In the palette, click Realization, then "Payments", then "Gift wrapping".
  3. The warning goes, and nothing takes its place: one application component realizing a service is no single point of failure. One node, device or system software alone providing it is, as for "Hosting".

Switching advice off

A finding is a rule's or advice. A rule reports a Violation: the model does not conform, as with a relationship the tables forbid. Advice reports a Warning or an Info: a principle, such as a single point of failure, or a viewpoint's completeness. Advice that does not fit how you work can be left out, in File › Settings… › Validation: a shape at a time, or a document of them whole. Rules cannot be.

A finding of advice has Switch off… after its shape: it opens those settings at that shape's switch, scrolled to, marked and focused, with what the shape checks, what its findings say and a link to its page, so a finding's message tells you which switch is its. Advice…, in the tab's header beside Model checks, opens them at Validation. What is left out is said after the summary, 2 shapes switched off, in either scope; click it to open them too. It is kept in this browser: la-gram-git, another browser and other tools still report it.

  1. Open the example, and the Validation tab: "✗ 1 warning(s), 2 info(s)", and 1 more in the model, Hosting's single point of failure. Click 1 more in the model.
  2. On Hosting's finding, click Switch off…. Settings opens at Single Point of Failure (Info), marked: “Service … is provided by only one technology element (…). Consider redundancy for critical infrastructure services.” Untick it, and Apply.
  3. Hosting's finding goes, and the summary says 1 shape switched off.
  4. Click 1 shape switched off, or Advice…: Settings opens at Validation. Tick it again, and Apply.

Model checks

Model checks, beside the tab's title, asks the loaded languages' finding questions of the model on request: those the SPARQL tab's Questions menu marks finding, such as orphans, unrealized services, unrealized requirements, elements with no definition. Their findings join the list, each with Check: and its question. A line under the summary says how they went: Model checks: 14 run, 11 findings, which stopped at their limit, and which could not run.

The button then says Run checks again. The findings stay until the next run or another model; after an edit, the line says the model has changed since they ran.

  1. Choose Model checks. It says Checking… while they run.
  2. The list grows: "Gift wrapping" again, from "Which services does nothing realise?", and the elements with no definition, from "Which elements have no definition?".
  3. Give "Customer" a definition, and choose Run checks again: it is no longer listed.

What is checked

Validation runs in a Web Worker, 300 ms after the last change, so that a burst of edits is checked once. On opening a model, and when the metamodels change, it checks the whole model; after an edit, only what the edit can change. It checks:

  • SHACL against the loaded metamodels' shapes and the core shapes: types, cardinalities, values;
  • relationships against the metamodel's relationship tables: which types may join which;
  • the shapes' SPARQL-based rules (sh:sparql), run with Oxigraph: ArchiMate's self-loops and principles, core's viewpoint rules, and how a relationship's multiplicity is written;
  • references to anything the model does not have: a relationship whose end is not in the model, say.

The planted warning is one of the SPARQL-based rules. The same question, asked of the example in the SPARQL tab, finds the same service:

PREFIX am4: <https://meta.linked.archi/archimate4/onto#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT ?service ?name WHERE {
  ?service a am4:Service ;
           skos:prefLabel ?name .
  FILTER NOT EXISTS { ?anything am4:realizes ?service }
}
service name
m:gift-wrapping Gift wrapping

la-gram-git checks a model file with the same engine, on the command line and in CI, and reports the SPARQL-based rules' findings as advisory:

$ la-gram-git check docs-site/examples
✓ docs-site/examples/shop.ttl
  · 4 from the shapes' SPARQL-based rules (advisory):
  ·   warning: Gift wrapping (Service) · Service Gift wrapping is not realized by anything. (https://meta.linked.archi/archimate4/principle-shapes#ServiceWithoutRealizationShape)
  ·   info: Payments (Application Component) · Application component Payments is deployed on only one node or device (Shop server). Consider multi-node deployment for resilience. (https://meta.linked.archi/archimate4/principle-shapes#CriticalNodeSingleDeploymentShape)
  ·   info: Web shop (Application Component) · Application component Web shop is deployed on only one node or device (Shop server). Consider multi-node deployment for resilience. (https://meta.linked.archi/archimate4/principle-shapes#CriticalNodeSingleDeploymentShape)
  ·   info: Hosting (Service) · Service Hosting is provided by only one technology element (Shop server). Consider redundancy for critical infrastructure services. (https://meta.linked.archi/archimate4/principle-shapes#SinglePointOfFailureShape)
  · IRI layout (DD-41), advisory:
  …

1 model file checked: all well.