Assigning Tags to Items
You can assign Tags to your models and data files to help you with organizing them in the database. You can even assign tags to the tags themselves, thereby building a hierarchical tree structure of tags — see The Tag Tree. In this regard, tags may remind you of folders on the file system. But tags go beyond that:
You can find models and data files in the database by searching on their assigned tags — either by matching textually on tag titles via Full Text Search or by applying a Tag filter on the unique keys of tags. You can even find models and data files by searching on ancestor tags — that is, tags assigned to the items’ tags themselves. For example, if you create an Interpolation Functions tag and assign it a My Project parent tag, you may assign the former tag to data files and then find those same data files by filtering on the latter tag.
-
-
-
The settings for tags are version controlled. If you change the title of a tag and click Save () in the Settings window, a new version of the tag is created. Any tag assignments involving the saved tag will, however, be left unchanged.
Creating New Tags
Click New Tag () in the Database section of the Home toolbar to open the New Tag dialog. The Location field shows the database, repository, and branch that the new tag will be created in.
1
In the General tab, write the title for the new tag in the Title field.
2
Select the Add to selected models and files checkbox if you want the new tag to be automatically assigned to the current selection of model and files in The Model Manager Window or The Databases Window (depending on which window has focus). The checkbox is disabled if no models or files are selected.
3
In the Parent tags tab, select tags in The Tag Tree that will be assigned to the new tag — in other words, its parent tags. Leaving all nodes in the tree cleared will create the new tag under the root. You can filter the tree of available parent tags by writing a tag title in the text field above the tree.
The tree is empty when you create your first tag.
4
In the Comments field, write an optional comment for the associated commit.
5
Click OK to save the first version of the new tag in the database.
If a tag version is selected in The Model Manager Window or The Databases Window when you click New Tag (), that tag will be initially selected as a parent tag in The Tag Tree in the New Tag dialog.
You can see your new tag under the branch node in The Databases Tree if you have selected Items when clicking Show () in the Databases window’s toolbar. You can also see it in the Tree View in The Model Manager Window as long as you have not written any search expressions in the search field or applied any filters.
The Tag Tree
Since tags can be assigned to other tags, items in a Model Manager database can be represented as tree nodes in an hierarchical tree structure. Items assigned a particular tag appear as child nodes to the tag node in tree. You can find a particular item in multiple positions in the tree as items can be assigned more than one tag. You can think of items not assigned any tags at all as placed under a hidden root tag.
You can browse the tag tree in The Databases Window if you have selected Items in the Show menu () or in the The Model Manager Window if you have selected the Tree button (). Expanding a branch tree node in the former window or searching a branch in the latter window shows the tag assignments at present time — see also Searching in Branches. To browse the tag assignments at some point in the past:
1
Right-click one of your branches under the Branches node () in the Databases window and select Commits ().
2
In the opened Commits window, right-click one of the commits in the table and select Search in Commit ().
3
The Tree View in the Model Manager window is updated to show the tag assignments as they were at the time the commit was saved.
If you have created a snapshot to record a specific commit, you can expand its tree node in the Databases window to see the tag tree at the time the recorded commit was saved — see also Searching in Snapshots and Commits.
Assigning Tags
To assign already created tags to an item, do one of the following:
Select the item in The Model Manager Window or The Databases Window and click the Set Tags button () in the Item section of the Home toolbar. You can select multiple models and files if you want to set the tag assignments of more than one item at once — see also Adding and Removing Tag Assignments.
Set assigned tags from the Tags section in the Settings window of Items. Do not forget to click Save () in the Settings window to save any changed tag assignments.
Set assigned tags from the Tags section in the Save window when saving a model version or in the Export window when exporting a file version — see also Saving Models to Databases and Exporting Output Directly to a Database.
All four options sets the tag assignments via a commit. The second, third, and fourth option also save a new version of the item. The first option does not, which may be preferable as to not create unnecessary Save Conflicts if, for example, a model item happens to be simultaneously open in the COMSOL Desktop.
Guidelines on Tag Tree Setup
Model Manager will neither prevent you from creating tags having multiple parent tags, nor will it prevent you from creating tags having the same title. While this gives you complete freedom in setting up your tag tree, there are some pros and cons that should be weighed.
Assigning more than one parent tag to a tag enables you to have multiple organizational subtrees with overlapping contents. You can, for example, have a main subtree used to uniquely categorize all your models and data files based on characteristics — much like files in folders on the file system. The tag layout in that subtree, once created, would seldom change. You can then have various other subtrees used to organize projects in which you want to work with whole collections of models and data files from the main subtree — rather than assigning the project tag to all those items directly, you assign it to some of the items’ assigned tags. This requires some discipline, though, to not end up with a tag tree that is hard to navigate.
By creating multiple tags with the same title, you can organizationally separate different collections of models and data files in the tag tree while still labeling these items using a common concept. This enables you, and your coworkers, to easily find the items when searching on the tag title, without making it difficult to browse them when navigating the tag tree. Having the same title for different tags will make it harder, though, to quickly identify where in the tag tree a specific item is located when viewing it in a result table or list. Moreover, you must now remember to select all of them when applying a corresponding filter for the common concept represented by the tags.