Nikolai Varankine - Applications - Thinker™
 Introduction   Software   Contacts   About Me   News   LinkedIn™   Quora™ 

📚 Import and Export

The Thinker™ normally uses a graph database to operate with models. Most parts of design hierarchy can be exported in human readable form from the database to a local file system. These files can be imported back into the database. These features allow to interchange models between different computer systems or create a copy for backup purposes.

A package of models is a self-sufficient container of information. It serves as a typical object during export and import operations. Usually, it contains all the data needed to reproduce computing schema on another instance of the Thinker. When a circuit references data from another database, a correspondent "foreign" package must be exported separately.

A customized XML¹ format is used for external storage (serialization) of the model. It mirrors hierarchical structure of project elements in the database. All native elements of computing schema are coded belonging to default brains namespace. Element type of the Thinker model serves as correspondent XML tag. All properties of the element are mapped to XML element name-value pairs, one-to-one. More technical information can be found in the DTD file.

When database structure allows references to separate nodes in this or another database (usually for modules, Java classes, and library contents), subset of the xlink namespace is used to describe the relationship.

Definition of the Thinker data model allows to merge structured data of any other sort, provided that it mentions a unique namespace. "Foreign" data appears in the XML file under the mentioned namespace. This way graphics data in the SVG format naturally accompanies computing and structural elements. For example, definition of a fragment element can include SVG picture for documentation purposes. A set of element properties can include SVG attribute to setup visual transformation, and so on.

Any XML file must pass a conformance check when it is imported into database. The Thinker provides very relaxed rules for the file contents. Generally, a file must meet requirements specified for a well-formed XML document. When unrecognized XML element or attribute is met during import operation, the Thinker warns user about incident but inserts data in question into database as-is, in presented textual form. Such "foreign" elements and parameters are simply ignored at normal operation. At the time of exporting, "foreign" data silently goes into generated XML file, intact. This implemented policy allows flexible and loss-free data exchange between different versions of software. It tolerates logical errors occurred during manual coding of XML files.

Visual representation of the model or its part can be exported in SVG format. Produced file can be shown in any compatible image browser. However, it can't be imported into the database because it doesn't contain essential model data. Native Thinker elements are converted into SVG g (group) element. Their SVG attributes, if present, can help to manage location of the graphic primitives within picture frame. The Thinker allows to use subset of xpath namespace, along with XML processing instructions, to include values of element parameters into generated graphics.

 

 

Notes:

  1. XML file is created in UTF-8 encoding to naturally support international languages.

Sections
Order
Tutorials