/ormjs

ORMJS is a completely clientside tool to produce Object Role Modeling (ORM) diagrams, accessible from any modern browser. It is implemented in javascript d3v7.

Primary LanguageJavaScript

ORMJS: Object Role Modeling in JavaScript

⚠️ This project is in active development. Consider this code an alpha prototype. Release notes will be published here.

ORMJS is a completely clientside Object Role Modeling (ORM) solution, accessible from any modern browser. It is implemented in javascript d3v7.

With ORMJS you can:

  • Generate ORM diagrams via an intuitive GUI interface.
  • Save your ORM diagram as an SVG or PNG.
  • Upload SVG files generated by ORMJS and continue editing them.
  • Generate Rel code from your ORMJS model.

See a demo of the latest version of ORMJS deployed here.

What is Object Role Modeling (ORM)

From the ORM website:

Object Role Modeling (ORM) is a powerful method for designing and querying database models at the conceptual level, where the application is described in terms easily understood by non-technical users. In practice, ORM data models often capture more business rules, and are easier to validate and evolve than data models in other approaches.

Note: Not to be confused with Object Relational Mapping.

Rel plus ORM

Rel is an expressive, declarative, and relational language designed for modeling domain knowledge. Rel is used by the RelationalAI Knowledge Graph Management System to create data models.

ORMJS generates Rel integrity constraints on-the-fly from the ORM model.

How to interact with ORMJS

ORMJS is designed to have a minimalist, intuitive user interface. Develop an ORM diagram using the following click events:

Event On Action
RightClick Canvas Create object menu
Dblclick Canvas Generate new entity
Shift + Dblclick Canvas Generate new fact
Ctrl + Shift + Dblclick Canvas Generate new value
Click + Drag Canvas Select multiple objects
RightClick Object Object context menu
Dblclick Object Open object property menu
Ctrl + Click Object Delete object

Objects can be created and modified using two menus:

  1. the object context menu (access via right-click on the object) and
  2. the object property menu (access via double-click, or via right-click --> Properties).

Objects can be connected by clicking on their overlays and dragging.

ORM 2 Graphical Notation Checklist

As features are added to ORMJS, track progress here against ORM 2 Graphical Notation standard. The first release and version tracking will begin upon completion of the items here.

Note: Asterisk (*) indicates partial support. Dash (--) indicates no planned support in V1.

Construct ORMJS Rel
Entity type
Value type
Entity type with popular reference mode
Entity type with unit-based reference mode
Entity type with general reference mode
Independent object type
External object type
Predicate
Duplicate type or predicate shape
Unary fact type
Binary fact type
Ternary fact type
Quaternary fact type
Objectification (aka nesting)
Internal uniqueness constraint (UC) on unaries
Internal UC on binaries
Internal UC on ternaries. For n-aries, each UC must span n-1 roles.
Simple mandatory role constraint
Inclusive-or constraint
Preferred internal UC
External UC
Object type value constraint
Role value constraint
Subset constraint
Join subset constraint
Exclusion constraint
Exclusive-or constraint
Equality constraint
Derived fact type, and derivation rule -- --
Semiderived fact type, and derivation rule -- --
Subtyping
Subtyping constraints
Subtyping derivation status -- --
Internal frequency constraint
External frequency constraint
Ring constraints
Value comparison constraints
Object cardinality constraint
Role cardinality constraint
Deontic constraints -- --
Textual constraints -- --
Objectification display options -- --

External packages

ORMJS uses d3-context-menu. This package is already integrated, nothing additional to download or install.

The ORMJS demo uses Prism to highlight Rel code. This package is already integrated, nothing additional to download or install.