Libraries in the ThinkIQ platform are where Types are created and stored. Libraries also provide a way to group Types and Instances. This makes it easy to import or export portions of the model.
The platform comes with a few built-in libraries that provide types that can be used when building a Model. These built-in libraries cannot be added to, or edited; but can be used to create instances or derive new types for use in the platform.
The ThinkIQ Base Library is a system library that comes with all platforms. You can see the types in the ThinkIQ Base library by navigating to the Types tab in the Model Explorer and filtering the Libraries column on 'ThinkIQ Base Library'. This library provides all of the base types that are in the system such as Organization, Equipment, Materials, Generic Objects, and others. All types created in the platform derive from a ThinkIQ Base Library type.
Users can create new types 'from scratch', or create types from existing types, inheriting all of its attributes and methods. When users create types*, those types are saved in 'Local Library' - a default library owned by the platform instance. Users can create libraries with other names, if needed.
Exporting and Importing Libraries
Libraries can be exported and imported to and from other ThinkIQ systems. This makes the engineering efforts of designing a Model reusable at multiple locations. When libraries are imported into a different ThinkIQ platform, they follow all of the propagation and deletion rules of the type system. This means that updates will occur not only on Types, but also on established instances of those types.
To import or export a library, open the Libraries grid.
Use the Export button on the grid row to export a specific library. There is an 'Export All Libraries' button on the grid toolbar if this is a desired action. Either will create a 'type_system.json' file in the downloads directory.
Use the 'Import Library' button on the grid toolbar to bring in the contents of a library. The file must be from a previously downloaded ThinkIQ library. When you import a library, you will be prompted to select the file to import, and determine how the import should reconcile any duplicate types that are discovered during import. Duplicates are based on the Type Name. These are the options for duplicates:
- Update
Update all types and instances of those types. This option will update any changed attributes within a type, or any values of an attribute. For example, if an attribute on the imported type has a different data type from the original type, that attribute will be updated, as will all instances of the Type. - Skip
If a duplicate type is found, skip it and only import the new items in the library. - Newer
The 'Newer' option is based on the timestamp of the two items. If the imported item has a newer timestamp, it will 'Update' the item. - Replace
When a duplicate item is found, the type is replaced with the type in the imported library, regardless of timestamp.
* Creating instances, types and libraries are functions restricted by user access levels.