Skip to content

Record what a model is based on

A logical model is usually not invented from nothing: its elements come from a conceptual model someone else maintains. ModelDesk records that as based-on lineage (the element Fiets in your logical model is based on Fiets in the conceptual model it came from), so anyone reading your model can see where each element came from, and you can see what breaks when the other model changes.

Lineage is recorded per element, between two models. It is separate from your model’s own history: versions and commits record how your model changed over time; lineage records what it was based on in the first place.

Base models, links and rules are saved to main directly, not to your draft, and an open draft is brought up to date with them. On another branch the Semantic Lineage page shows main, and its links and rules cannot be changed there: “Links, rules and counts show main, not v3. Changed on main only.”, with Switch to main to open the model on main.

  • A model you can edit, with Semantic Lineage in the left navigation.
  • The model you are basing it on, already in ModelDesk.

Before any element can be linked, the model it comes from has to be declared. That happens once, in the model’s settings.

  1. Open your model and select Settings in the left navigation.

  2. Find the Based on section and select Add base model.

  3. Pick the Base model: the model yours is based on.

  4. Pick a Version. Choose a released version to pin to a point that will not move under you, or Latest commit to follow the base model as it changes.

  5. Set the Relationship type, which says how the two models relate:

    • Vertical: they sit at different abstraction levels, for example conceptual to logical. This is the usual case.
    • Horizontal: they sit at the same level in different representations.
    • Unspecified: leave it open for now. You can classify it later, but not un-classify it.
  6. Select Add.

The base model now has a row in the Based on table, showing its relationship, the version you pinned, how many of your elements it generates, how many are linked to it, and whether the pin is still up to date. You can change the relationship straight from that row.

A model you generated from a base model already has its row. Its Links column reads Allow links instead of a count: select it before you link any element to that base model. The links are recorded at the version and relationship the row already shows.

Select Semantic Lineage in the left navigation. It opens on the Overview, the list of every link in the model. The Split view beside it is where links are drawn.

  • Overview lists every based-on link in the model. A link from one element to several base elements is one row, which names the element and a count such as 3 elements, and expands to list them. Search it, or filter to Generated, Linked or Broken to see one kind at a time.
  • Split view shows the element you select as a diagram on the left and the base model’s diagram on the right, with the base model’s tree beside it. A model whose standard has no diagram notation shows an outline of the element instead (see Models without a diagram). This is where links are drawn.

Select an element in the tree, or a row in the list, to open that element’s page. From the editor, Open in Semantic Lineage in the element’s More actions menu opens the same page; it is unavailable on an element that exists only in your draft. The page shows:

  • A picture of the element’s lineage in both directions, with each model in a lane for its abstraction level. What the element is based on sits above it when it is more abstract, and to its left at the same level. What is derived from it sits to its right at the same level, and below it when it is less abstract, including elements in other models. Elements whose relationship you left Unspecified sit in an Unplaced lane until you classify it, and the page names that base model above the picture with Set relationship to place these. Hover a pill on a line to see its rule. Select the pill to trace what the rule touched, and select it again to open the rule. A pill on a line from another model opens that model’s page for the element the rule explains.
  • One card per rule under Rules. A Generated card shows what the last generation wrote into each field, and Open in Mappings opens the rule where it is kept. A Linked card shows how the link fills each field, and Edit in Split view opens it where it is drawn. The fields a rule leaves alone fold behind a count such as 11 fields not set.
  • The element’s parts that have lineage of their own, such as its attributes, under Parts of. Select one to open its page.

All links at the top of the page returns to the list, with the element still selected. Beside it, the element’s owner, such as the class an attribute belongs to, opens that element’s page.

In an element’s picture and in the Split view, every lineage line is drawn the same way: dashed purple, between the element derived and its base element, with the arrowhead on the base element and a dot on the derived one. It points at what the element is based on, as on the model overview. The line runs through a pill naming the rule that made it, read the same way round: Fiets ⇢ Persoon says that Fiets is based on Persoon. The pill’s icon says what the rule did: purple for a rule that generated the element, blue for a rule that linked it.

Under the header, a card names each base model with its relationship, the version it is pinned to and its counts. Its Rules link opens that base model on the Mappings page, where the rules that generate elements from it are kept.

Each element says for itself what it is: Generated when a rule produced it from the base model, Linked when it is connected to a base element, and Broken link when the element it pointed at is no longer there. Those words are the same on its row in the list and on its page. A linked row also says how its base elements were found: drawn when someone drew them, query when a query finds them.

JSON Schema and XML Schema have no diagram notation. In the Split view, a model on such a standard shows the selected element as an outline, on your side and on the base side alike:

  • Across the top, the path to the element’s owner. Select a name in it to open that element.
  • The element itself as the first row, highlighted. Under it, its parts as the model tree shows them, grouped under headings such as ALL OF and PROPERTIES, three levels deep. The chevron on a row folds or opens it.
  • An element that is only referred to, such as the target of a $ref, is a row with a link icon. Select it to open that element where it is defined.

Lines end on the rows, as they end on the boxes of a diagram. On your side, the outline draws the selected element’s lines, and every other row with lineage carries the marker it has in the tree. Select a row to see its lines. The outline then opens on that element.

A link says that one element in your model is based on one or more elements of the base model. You draw it in the Split view: a line from a box in the base model’s diagram onto the element in yours. Nothing is saved until you select Link.

  1. On the Semantic Lineage page, select Split view, or Link elements on the Overview.

  2. Select the element in your model, in the tree on the left or in the left diagram. The left diagram centres on it.

  3. The aside on the right names the Base model. If your model is based on more than one, pick it there.

  4. Find the base element: pick it on the aside’s Tree tab, or select a box in the right diagram. The right diagram centres on it.

  5. Boxes in the right diagram carry a round handle on the side facing your model; its tooltip reads, for example, Drag onto Fiets to link. Drag from the handle onto your element’s box in the left diagram and release. Clicking the handle does the same.

    The new line is dotted, and the aside switches to its Lineage tab, where a card for the new link is open with the base element as a row under Base elements.

  6. If the element is based on more than one base element, draw a line from each box. Each becomes a row.

  7. Optionally, explain the element’s values under Fields of Fiets (see Explain the values) and add a Description saying why the link holds.

  8. Select Link. The button counts the rows, for example Link 2.

The lines turn solid, the aside reads Linked, and the element carries the Linked verdict everywhere it appears.

While you draw:

  • To link an attribute rather than its class, select the attribute in the left tree. The left diagram shows it as a row of its class’s box; drop the line on that row.
  • A relation cannot be linked. With one selected, the handle says Select a box or an attribute to link it.
  • A box the base model shows from one of its own dependencies has no handle: only the base model’s own elements can be linked.
  • A base model without a diagram notation shows the base element as an outline (see Models without a diagram). The handle sits beside each row, on the side facing your model. The selected row’s handle always shows, and another row’s shows when you point at the row or reach it with Tab. Drag or click it as you would from a box. When your own model has no diagram notation, drop the line on the row of the element you link.
  • A base model your model is only generated from shows its generated lines, but nothing can be linked to it until you select Allow links on its row in the settings (see Declare a base model). Until then its handles say This base model doesn’t allow links yet., and the Lineage tab says the same.
  • If you go to the Tree tab to find another box, a strip at its foot keeps the unsaved link in view, for example Fiets ← 2 · back to link. Select it to return to the Lineage tab.
  • Remove a row you drew by mistake with the × on that row.
  • Selecting another element or another base model before you select Link discards the unsaved lines, without asking.
  • The aside shows the Relationship declared with the base model.

A link records where an element comes from. It can also say how each of its values is derived from the base elements. Under Fields of Fiets, the link’s card lists one field for each property the element’s type declares, such as naam and definitie. A field you leave empty is fine: the link then claims nothing about that value.

  1. Select a field to open it.

  2. Choose how the value is derived:

    • Copy reads one attribute of the base element.
    • Combine joins attributes and text, in the order you list them.
    • Split keeps the part of an attribute before or after a separator.
    • Map value writes a value of your own for each value you list.
    • Fixed value writes the same text every time.
    • Query lets you write the expression yourself.
  3. Pick the attribute to read from the list. It offers the base element’s own attributes and those one relation away.

Under the field, a line reading Result for followed by the first base element’s name shows the value the field would get.

To read a value more than one relation away, follow a path to it in the base model’s diagram. The Fietsenwinkel conceptual model has an example: Fiets heeft motor Motor, and Motor wordt aangedreven door Batterij. To read the name of the battery for Fiets:

  1. In the field, select the + beside the attribute list. Its tooltip reads Follow a path in the base diagram.

    The right diagram gets an amber outline and a banner: Path from Fiets: click a line or a row to follow it · Esc stops. Until the path ends, a click in that diagram follows a line instead of selecting.

  2. Click the line heeft motor. The diagram re-centres on Motor, and the field shows the path so far: Fiets › heeft motor ›.

  3. Click the line wordt aangedreven door. The diagram re-centres on Batterij.

  4. Pick the property to read under Search properties, for example naam.

The field now reads heeft motor › wordt aangedreven door › naam, and the diagram returns to where the path started.

A click on a row follows the path onto that attribute instead, so you can read one of its properties: aantal versnellingen › definitie. Clicking a box does not move the path. To stop without changing the field, press Esc or select the × beside Search properties.

A path starts at the base element in the right diagram when it is one of the link’s, and at the link’s first base element otherwise.

On a base model without a diagram notation, a path runs through the outline. Click a row directly under the element the path is on, such as a property under PROPERTIES. The outline opens on that element, and the field adds it to the path. A link row takes the path to the element it points at. A heading only folds or opens its group. A click on a row deeper down does not move the path, and the field says, for example, Click a row directly under Registratie. For a row that leads to an element the base model does not hold, such as JSON Schema’s built-in false schema, the field says This row leads out of the base model.

When the base elements are easier to describe than to draw, let a query find them. The link stays one link on one element of yours; its base elements are whatever the query matches.

  1. On the link’s card, switch Base elements from Drawn to Query.

  2. The query box starts with a query that names the boxes you drew, so it finds those. Edit it to say which elements you mean. If the boxes you drew are of different types, the box starts empty.

    In a SPARQL box, the starting query is SPARQL. For a concept you drew named Gemeente, it reads:

    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT ?e WHERE { ?e a skos:Concept ; skos:prefLabel ?l . FILTER(str(?l) = "Gemeente") }

    Where the base model’s RDF rendering cannot name a box you drew, the query starts in Core DSL instead.

  3. Check the count under the query, Elements found · N, and the rows under it. They are what the link will point at.

  4. Select Link.

Switching back to Drawn brings back the rows you drew, and the query is kept for when you switch again. While Query is on, you cannot draw a line: the handle asks you to switch to Drawn first. Link stays unavailable while the query finds nothing.

A link is about elements your model already has. To create elements in your model from a base model, use a rule on the Mappings page: select the base model under Based on, then New rule. Saving a rule runs that rule. Generate runs every rule of the base model in one go, for example after Use these rules or after you upgrade the base model.

A query box can hold SPARQL or Core DSL. Above each box, SPARQL and Core DSL show which one it holds and let you change it. That goes for every query box on a link’s card, and in the rule editor for the rule’s scope, its fields and the ends of a relation.

An empty box starts in SPARQL. A box that already holds a query shows that query’s language.

What a switch does depends on what the box holds:

  • An empty box only changes language.
  • A field’s query that the field can show as Copy, Combine, Split, Map value or Fixed value is rewritten in the other language. Under the box, Rewritten from Core DSL. offers Undo until you next edit the box.
  • Any other query is set aside under the box, which starts empty in the new language. The query stays there, dimmed, under Core DSL · kept, not saved (or SPARQL · kept, not saved). Restore puts it back in the box, in its own language, and sets aside whatever you typed in the box since. Each switch sets aside its own query, so a second switch keeps the first one too. It is not saved with the rule, and it is gone when you discard your changes or leave the rule.

A field you derive with Copy, Combine or another way writes its query in the box’s language. The SPARQL comes from how the base model is rendered in RDF, so a field that holds a SPARQL query waits for that to load and reads Reading the RDF vocabulary… meanwhile. A field you edit before it has loaded is written in Core DSL, with Written in Core DSL. The RDF rendering’s vocabulary is still loading., and your next edit writes SPARQL. Where the rendering has no SPARQL for what you picked, the field writes Core DSL and says why, for example Written in Core DSL. The RDF rendering does not write iri.

A long query is easier to read over several lines. Choose Format in the top-right corner of a query box, or press Shift+Alt+F (⇧⌥F on a Mac) while you type in it. Core DSL gets each pattern and each and or or on a line of its own; SPARQL gets a line per triple and per OPTIONAL or FILTER, indented by group. Formatting changes only line breaks and indentation, so the query means the same and keeps your comments. Format shows only while the pointer or the cursor is in the box, and only when there is something to lay out. A query with an unclosed string or bracket is left as it is.

SPARQL is offered only when the organization that owns your model has SPARQL enabled, and the base model’s standard supports querying. Without it, the boxes show no switch and hold Core DSL.

A box that already holds SPARQL keeps it, tagged SPARQL, with a sentence under it that says why:

  • SPARQL is not enabled for your organization, so this query will not run.
  • SPARQL is not offered for XSD, so this query is not checked here. The sentence names the base model’s standard.

A link’s card on the Lineage tab is the rule editor folded to its simplest. When a link needs more, select Open in rule editor → at the foot of the card. The rule editor opens over the split view on the link as the aside holds it, unsaved changes included, with its Source, Rule and Outcome panes. Save saves the link and returns you to the split view; Cancel returns without saving and leaves the aside as it was.

In the Split view, the aside’s Lineage tab lists every rule that touches the selected element on the chosen base model, under Rules on this base model: one card per rule, folded to a row that says its kind, Generated or Linked, names the rule and says what it reads. Select a row to open the card; the rule’s pill on the line lights up with it. Press Esc to fold it again.

  • A Linked card holds the link as the sections above describe it, with its own Link and Remove buttons.
  • A Generated card is read-only. It shows what the last generation recorded: under Generated from, the base elements the element came out of, and for each field where its value was read from, such as naam ← Fiets › naam. When the base model has changed since, the row carries an amber dot and the card says Needs regeneration. Open in Mappings → opens the rule on the Mappings page, where it is edited.

A link explains one element. The elements it holds, such as an Objecttype’s attributes, can each get a rule of their own, nested under the link’s rule. A nested rule runs from the base element its parent matched, and records its own links.

An example from IMAdres, which is based on IMBAG Conceptueel: the rule Adres ⇢ Nummeraanduiding links Adres to Nummeraanduiding. Under it, nested rules explain the attributes of Adres:

  • huisnummer comes straight from the huisnummer of Nummeraanduiding itself.
  • straatnaam comes from the naam of the Openbare ruimte that Nummeraanduiding ligt aan: Nummeraanduiding › ligt aan › Openbare ruimte › naam, recorded as straatnaam ⇢ naam.
  • plaatsnaam comes from the naam of the Woonplaats that Nummeraanduiding ligt in, and where it lies in none, from the Woonplaats its Openbare ruimte lies in.
  • adresregel reads four base elements: the naam of Openbare ruimte, huisnummer, huisletter and huisnummertoevoeging.

Read together, the rules say what an address stands for in the terms of IMBAG Conceptueel. An Adres whose straatnaam is Kerkstraat stands for: its Nummeraanduiding ligt aan an Openbare ruimte whose naam is Kerkstraat. The parent rule says which Nummeraanduiding an address is about, and each nested rule’s route is the path of what it states.

  1. In the Split view, select the element to explain, such as straatnaam under Adres.

    When the element it belongs to has a saved rule, the Lineage tab says Part of Adres ⇢ Nummeraanduiding and Click what straatnaam is based on. The base diagram opens on what the parent matched, Nummeraanduiding, where the routes start. On the parent’s card, Nested rules · N lists the elements it holds; Nest a rule on a row selects that element the same way.

  2. In the base diagram, click what it is based on, such as the naam row of Openbare ruimte.

    The split view works out the route from what the parent matched, here Nummeraanduiding › ligt aan › Openbare ruimte › naam, and drafts the nested rule along it. Its line runs from the derived row through its own pill to the base row, and the lines the route crosses turn teal. With straatnaam selected, only its own rule’s lines are drawn. Select Adres to see every rule of the tree: the parent’s and each nested rule’s, with a rule not linked yet drawn dotted.

    Where several routes lead there, the card lists them in words, such as via ligt in › Woonplaats › naam. Hover one to see it on the diagram, and select the one to use. The first entry uses them all, in the order listed: each later route is tried only where the ones before it found nothing. Where no route is found within four steps, the card says so.

    Walk a route walks it by hand instead (see Walk a route by hand); Write a query starts the rule with an empty scope query.

  3. The card shows the scope as the steps of its route. Change route lists the other routes to the same element, and Edit as query shows the query the route is written as, from $self, the element the parent rule matched. Where the box offers SPARQL, the query is written in SPARQL, and you can edit it as text. Reads · N lists the base elements it reads, in the order of the routes that read them.

  4. Optionally, add values to the rule’s Fields with Add a value, as you would on a link’s card (see Explain the values), and add a Description.

  5. Select Link on the parent’s card. The nested rule is saved with it. Saving records N lineage links counts the links of the parent and all its nested rules, and so does the button.

Once saved, the nested rule folds to a row with its name, such as straatnaam ⇢ naam, followed by what its scope crosses and how many links it records: ligt aan › naam · 1 link. Its links are drawn like any rule’s, through a pill of their own, and the Overview and the element’s page list them under that rule. A nested rule that records no link yet says not linked yet on its card.

A nested rule can read along more than one route, in the order they are listed. Between two routes, a toggle says how they go together:

  • Where nothing was found: the routes are alternatives, the earlier one preferred. An address’s plaatsnaam is the naam of the Woonplaats its Nummeraanduiding lies in, over ligt in, or, where it lies in none, of the Woonplaats along ligt aan › Openbare ruimte › ligt in. The query reads the later route only where every route before it found nothing.
  • For every element: each route holds, beside the routes before it. adresregel reads along four routes this way and records a link to each base element. Its routes are the paths of the same facts straatnaam, huisnummer, huisletter and huisnummertoevoeging state, and those attributes give the values.

To add a route, select Add a route on the card. The card says Click what else adresregel is based on. Click the base element: one route there is added at once, several are listed to choose from, and Walk a route walks one by hand. Cancel or Esc stops adding. A route to where a route already ends is added to run where nothing was found; a route to anywhere else, for every element.

Where nothing was found is offered only on a route that ends where a route before it ends: another way to the same base element. A route that ends elsewhere reads something else, so in place of the toggle its divider says For every element, followed by why, such as no route before it ends on huisletter.

Each route has a numbered box with buttons to move it up or down and to remove it. The first route always runs for every element, so a route moved to the top loses its Where nothing was found. So does a route that a move or a removal leaves with no route before it ending where it ends.

Several routes need SPARQL. Where SPARQL is not offered, a scope has one route: the routes to an element are listed one at a time, and Add a route is offered only to a rule that has no scope yet.

A scope of several routes is one SPARQL query: a UNION of the routes that run for every element, and an OPTIONAL per route with COALESCE taking the first answer where later routes run where nothing was found. Core DSL says one route. Switching such a scope to Core DSL sets its query aside with the reason; Restore puts it back.

Walk a route starts a walk in the base diagram from what the parent matched. The diagram gets an amber outline and a banner such as Walking from Nummeraanduiding, the element Adres ⇢ Nummeraanduiding matched. Click a line to cross it, a row to finish. Esc stops.

  1. Click a line to cross it, here ligt aan: the diagram re-centres on Openbare ruimte.
  2. Click a row or a box to finish on it, here naam. The card also lists what you can finish on; select one to finish there. For huisnummer, click the huisnummer row of Nummeraanduiding without crossing a line.

Step back undoes the last line you crossed. To stop, press Esc or select Stop walking; a rule drafted just for the walk is removed again, and a route being added is not added.

While a walk lasts, Link, field paths and the other cards are unavailable and say Finish the walk first. Opening the rule editor ends the walk.

A few things to know:

  • A nested rule needs its parent saved and matching something in the base model: that is where it runs from. Until then, the card says why.
  • An element has one rule per base model, nested rules included. A row whose element already has a rule on this base model shows that rule’s name instead of Nest a rule. Select it to open that rule.
  • In the split view, a rule cannot be nested under a nested rule.
  • A save is refused when a nested rule finds nothing, and the message names that rule. Change its scope, or remove it.
  • To remove a nested rule, select Remove on its card, then Link. Its links are removed with it.

On a nested rule’s card, select Open in the rule editor. The rule editor opens over the split view on that rule, with the base model, the parent rule and the nested rule in its header.

  • Location reads Held by the rules that nest it, and the Derived element is fixed to the element the rule explains.
  • The scope runs from $self, the element the parent rule matched. Left empty, the rule reads that element itself.
  • Walk again in the split view returns to the split view and walks the scope again from what the parent matched. The current scope stays until the walk finishes.
  • Save saves the parent’s rule, with all its nested rules.

On the Overview, each row offers Open, which opens the Split view with the aside on that rule’s card: a linked row on its link, a generated row on its read-only card. You can also select the element in the Split view yourself: an element with a link opens the aside on its Lineage tab.

  • To change what the link is based on, draw another box or remove a row with its ×, then select Link. Until you change something, the aside reads Linked instead of offering Link.
  • To change a field or the description, edit it and select Link.
  • To remove the link, select Remove on its card, or remove its rows. Removing the last row of a saved link asks you to confirm in Delete link; select Delete to remove the link, and how its fields are derived with it. A link with nested rules loses them too, with their links, and the dialog says so.

A link with no rule behind it, recorded as a single pair, works a little differently. Its row on the Lineage tab has an Unlink button instead of ×, and its row on the Overview also offers Unlink. Once you change such a link on the Lineage tab and select Link, it is saved like any other link and keeps its description.

A link is broken when the base element it points at is gone, usually because the base model changed and you moved its pin, or because someone deleted the element.

Filter the Overview to Broken to find them. Broken rows are listed first and carry Broken link. In the Split view, an element whose link is broken shows a notice in the base pane that the linked element no longer exists in the base model, with:

  • Unlink, for a link with no rule behind it, which removes the link;
  • Review in list, which opens the Overview.

Any other link is repaired by changing it. For a drawn link, open it, remove the row that reads Missing element, draw the element that replaced it if there is one, and select Link. For a link whose base elements come from a query, change the query.