Version 0.96 is now live

We’ve just pushed version 0.96 from test to release, making it available by clicking here or on the “Online Modeler” menu item. Please see the three previous posts for details of what has changed since 0.95 (which is still available online here). As well as the listed changes, the following has been done:

  • Fixed a bug in the column name for attributes in the insert trigger.
  • Fixed bug in update trigger for knotted historized attributes.
  • Fixed bug where the navigation miniature was updated at every frame of a dragging operation.
  • Fixed a bug where the modeler could crash after a delete operation, trying to write out a non existent node name.
  • Fixed a bug in the update trigger for the ChangedAt column.
  • Fixed a bug where the miniature could get stuck in a resize loop causing the browser to hang.
  • Changed the edge stiffness algorithm (back) to a more physically accurate one.

This also means we are beginning development of 0.97, of which a test version soon will be made available. Trust me that we have some very interesting features coming in the next version!

Space partitioning

Graph layout with space partitioning

Showing the debug information for space partitions in the graph layout.

We have added space partitioning to the graph layout engine in the modeling tool (rev. 411 now live in test). This will improve performance for very large graphs. The idea is to first divide the space containing the graph into a number of sections called partitions, then calculate the “center of mass” for each partition with respect to the contained nodes, and then calculate the collective repelling force in each partition by the other partitions. Rather than having to do an exponentially growing iteration over nodes and other nodes, we can now iterate only over nodes in the same partition, calculate their respective forces with an addition of the already calculated force in the partition, and move to the next partition.

Looking at recent research in graph layout, an octree is used for the partitioning. However, constructing an octree was not fast enough, so we decided upon another method. The partitioning is made by dividing the node coordinates by the partition size and converting the result to an integer. A hashtable is used to contain the partitions with a pointer to an array of the contained nodes.

This works well, except that since we are continuously moving nodes around, we may get into a situation where nodes are “jumping” between two different partitions, and the layout never reaches equilibrium. We were able to remove such jittering by making the partitions fuzzy, with respect to their size. Every iteration of the layout, the size of a partition will be somewhat different, resulting in the nodes always settling down in a single partition.

In the screenshot above you can see the different partitions in grey (switch on debugging in the test version to see for yourself), and a grey small square in each partition indicating its center of mass.

New features in test

We have updated the test version of the modeling tool to version 0.96 revision 407:

http://www.anchormodeling.com/modeler/test

Updates in revision 407 (and earlier):

  • Fixed bug with restatement control rendered useless in bitemporal models.
  • Added restatement control for ties.
  • Fixed bug where setInterval was being called too many times in older browsers.
  • Replaced setInterval code with setTimeout in older browsers.
  • Sped up rendering even further by pushing run once-if-statements to init-functions.
  • Added insert triggers on the latest views for ties, with idempotency control.
  • Fixed all insert triggers such that when knots are involved, either the ID or the value column from the knot can be used, whereas previously the value column had to be specified.
  • Added delete keyboard shortcut ‘d’.
  • Added a (long overdue) consistency check for ties, such that roles cannot become ”deep-equal”, according to the XML Schema for anchor models.
  • Roles in a tie can now have the same name, as long as they do not refer to the same anchor.
  • Removed triggers from anchors that have no attributes (to fix broken code generation).
  • Temporalization metadata is now recognized when models are loaded.
  • Fixed bug that made input fields repeat more than once when selecting bitemporal output.
  • Improvements of how knots are handled in the triggers.
  • The naming convention now allows upper and lower case Latin-1 characters.
  • The naming convention is changed in order to support multiple attributes on the same anchor referencing the same knot. In order to be consistent, the name of the identity in the attribute was changed accordingly.
    This change is NOT backwards compatible!
  • Edit (revision 409 released on Oct 30):
    Added an option in the “Defaults” menu to change back to the “Original” naming convention. This quickly became a public request!

Use this with some caution as some changes are not backwards compatible. Should you decide to use this version you cannot go back to a previous version. You cannot mix the output from this version with an existing implementation either, since the naming convention will differ. However, it should be quite easy to migrate to a new version if you have a new and an old implementation side by side.

Modeler 0.96 available for testing

We have set up a development snapshot of the modeler (v0.96) in order to make it available for testing. It can be reached by clicking the link below:

http://www.anchormodeling.com/modeler/test

This version currently includes improvements to the graphical user interface, an abundance of descriptive tooltips, new and more perfomant rendering in the very latest browsers, and idempotency control.

Idempotency controls whether the insert and update triggers should ignore and discard any attempts to insert or update a value that is identical to the currently stored value (in changing time). Say for example that the attribute “Surname” has the value “Rönnbäck” from “2004-06-19″ and that it has been marked as idempotent. Then any attempt to insert the value “Rönnbäck” with a later changing time will be silently ignored.

As such, idempotency can be of great use in systems that receive many repeated values where it also can be ensured that information arrive in changing time order. In a situation where information may arrive out of changing time order, idempotency should be avoided, since there is no way of knowing what values may come between the one you are trying to insert and the currently stored one.

Online Modeler Updated to 0.95

The online modeler has been updated to version 0.95, which includes the following features and fixes:

NEW FEATURES

  • Full support for bitemporal modelling.
  • Latest views behave like tables thanks to insert, update, and delete triggers.
  • Restatement control for historized attributes.
  • Searching in models.
  • Optionally hidden mnemonics for less cluttering.
  • Optionally hidden attributes using implode/explode on models or parts of a model.
  • Metadata is now optional.
  • Improved layout for smaller screens.
  • Keyboard shortcuts.
  • Editing window can be closed by pressing ‘Return’.
  • First field in the editing window automatically gets focus.
  • Public models can be shared using a simple URL.
  • Twitter integration for public models.
  • Models can now be deleted from the cloud.
  • Models can now have a description.
  • Improved model browser for the cloud.
  • Straight edges can be set to improve performance on older hardware.
  • Capsules (schema owner) can be specified.

BUG FIXES

  • Added checks for mnemonic uniqueness.
  • Fixed the issue where historized ties could get an uneditable time range.
  • Fixed keyboard shortcuts from being active in all editable fields.
  • Fixed CR+LF problem in the generated SQL.
  • Ties will now always have an identifier.
  • Reduced the number of string objects created by the modeller.
  • Fixed bug where cardinalities were not shown in the SVG output.
  • Fixed missing items in the generated HTML documentation.
  • Changed the z-index of menus so they overlap gracefully.
  • Refactored global variables that were just global because of laziness.
  • Rewrote the delete operation, so that it will no longer go berserk.
  • Fixed mouse wheel zooming on Macs.
  • Fixed bug in imploded edges.
  • Fixed the issue where only 20 items from the cloud would be returned.
  • Removed recording time from knots.
  • Improved security in the cloud connection.
  • Fixed the isEmpty function for boolean values.
  • Fixed bug with empty WHERE clause for 1-1 ties.
  • Fixed select all (Ctrl+A) in the generated code window.
  • Fixed bug where default capsule would not affect new items.
  • Fixed bug where default identity would not affect new anchors.

IMPORTANT: The XML may be updated such that it is no longer backwards compatible. Please save and keep a copy of your model XML before migrating to a newer version, in case you need to go back. The old versions can be found by clicking here.

Temporal Entity Integrity

In order to ensure temporal entity integrity in a bitemporal model a few constraints have to be in place:

  • Primary key constraint over (ID, ChangedAt, RecordedAt, ErasedAt) that ensures that no duplicate rows can exist.
  • Unique constraint over (ErasedAt, ID, ChangedAt) that ensures that no temporal duplicates can co-exist for the same entity and version.
  • Check constraint that ensures that RecordedAt < ErasedAt.
  • Check constraint that ensures no overlaps in the recording timeline.

These have now been added to the modeling tool in the test version, and can optionally be switched off from the “Defaults” menu. Below is a script that tests the functionality of these constraints.

Temporal Dimensional Modeling

Borrowing concepts from Bitemporal Anchor Modeling we have created a suggestion for how to temporalize Dimensional Modeling. It makes use of the distinction between immutable and mutable information to introduce a dimensional anchor for every dimension. It uses the rewind and point-in-time parametrized views. It used the proper primary keys together with foreign keys to achieve table elimination (immutable data is not touched during execution of a query). It uses constraints to ensure temporal entity integrity.

Note that this does in no way imply that we favor Dimensional Modeling over Anchor Modeling. It just shows that the techniques developed in Anchor Modeling can be widely applied in other modeling techniques.

Retail Skeleton Model

We have made our first generic skeleton model for retail businesses available. You can open it in the modeler by clicking here. Feedback and improvements are very welcome, either by sending them to us or by “forking” and publishing your own modified version of the model. It should also serve as a somewhat larger example model that we can and will use in presentations and courses.

Complex Bitemporal Test

We recently brought attention to the need for more complex bitemporal test data in the LinkedIn group Temporal Data. Craig Baumunk of temporaldata.com then made data following some of our suggestions available to the group, and we have now implemented that using Anchor Modeling. The model can be seen here:

http://www.anchormodeling.com/modeler/test/?id=ag1hbmNob3Jtb2RlbGVycg0LEgVNb2RlbBiCyhEM

In order to generate the bitemporal SQL code for the model, first set Temporalization to “Bitemporal” from the Defaults-menu. You will then get the first part of the script seen below. It is followed by a section in which Craig’s data is loaded into the model. Finally, scroll down to the bottom to see how easily bitemporal data can be queried and joined.

Bitemporal Anchor Modeling

Bitemporal Anchor Modeling is now ready for testing in the latest test version. The last piece of the puzzle, bitemporal relationships (ties), have now been added as well. I believe there is little need for triggers on the ties. Let us know if you think otherwise. The following views should be available on all ties, where l = latest, p = point-in-time, d = difference, and the first position for changing (valid) time and the second for recording (transaction) time:

ll, lp, pl, pp, dl

The other combinations, such as ld, pd, etc, have been considered of less use and may be added at a later time. Once this version has been tested and deemed stable, it will be pushed to release status.