Bootstrap: drafting a model from the tag tree¶
The editor's Draft from tags card (also system.artekis.contextModel.bootstrap and
POST /data/artekis/web/context-model/bootstrap) drafts assets from what the gateway holds under up to 20 root paths,
from four sources: UDT definitions and instances (udt), the folder tree (folders), alarm configuration (alarms)
and historian registration (history). A root can also name an asset tree held in a database:
query:<Project>/<Path/To/Query> names a select named query with no parameter, in a project read.projects allows,
whose every column is a level of the tree, top first (an ISA-95 table's enterprise, site, area, line, cell); each row is one
path, ending at its first blank cell. Each level becomes an asset of the column's name as its type, a child of the level
above, its id the slug of the names down to it, so a re-run maps to the same ids; these assets carry no tags (add tag
roots to the same draft, or add tags in the editor). A query outside the policy, with a parameter, or that fails is
skipped with a warning. A UDT instance becomes an asset of its UDT type, a nested instance its child;
a folder holding assets or loose tags becomes a parent asset of type area; a tag's unit is its engUnit and its
limits come from its setpoint alarms; setpoint roles and normal ranges are never drafted. Asset ids are slugs of
the tag path, so a re-run maps to the same ids. At most 20,000 tags are scanned and 500 assets proposed; past either
the draft says truncated: narrow the roots. A draft of 19,400 tags into 242 assets took 3.1 s.
- A draft is never stored. Leaving the page drops it. Review it asset by asset (or accept all high-confidence ones), press Add accepted to model (which changes only the working copy) and then Save, which is one write of the whole model. An accepted asset whose parent was not accepted is saved at the top level.
- A re-run only adds. It never changes a saved asset's name, parent or tags; an asset, tag or alarm already in the model is not proposed again, and a saved asset that would gain tags or alarms is proposed with only those.
- Suggest (the switch on the card) adds one writer-role model call that proposes readable names, groupings for loose tags and relations, each marked as the model's. It needs an active provider; it sends tag paths, names, types and units, never a value or a setpoint; it is recorded like a run and appears in Cost and Egress. It lists at most 200 tags per asset, in draft order, and tells the writer how many it left out; a prompt over the model's input ceiling is refused before any call. The press waits for the answer (up to the writer's call timeout).