When working with molecular design, especially in complex workflows, one of the significant challenges is efficiently managing the properties of nodes. The propertyModel attributes in SAMSON’s Node Specification Language (NSL) provide a solution to this issue by offering a structured way to define and query these properties. This blog post will guide you on how to leverage the propertyModel attribute space to ease your modeling tasks.
What is the ‘propertyModel’?
The propertyModel attribute space (shortcut: pm) in SAMSON NSL specifically applies to property model nodes. This structure allows modelers to define and query attributes tied to node properties with precision. The attributes can be used to assess visibility, assign names, check for materials, and more.
Why Is It Useful?
Without a structured approach like propertyModel, nodes could become difficult to track and manipulate in large molecular systems. Imagine searching for invisible nodes or identifying which nodes own materials—it would be a tedious process without attributes such as visible (v) or ownsMaterial (om). Using these attributes streamlines node management and allows you to programmatically interact with your models with clarity.
Key Attributes of ‘propertyModel’
Here are some of the most commonly used propertyModel attributes and what you can do with them:
- hasMaterial (
hm): Indicates whether a node has material. Possible values:trueorfalse. Example expressions:pm.hm,not pm.hm. - hidden (
h): Identifies nodes that are hidden. Example use cases include toggling visibility for analyzable nodes. Example expressions:pm.h,not pm.h. - name (
n): Lets you handle nodes by their names. Supports string-based queries. Example expressions:pm.n "A",pm.n "L*". - ownsMaterial (
om): Checks nodes for ownership of materials, another critical aspect of node management. Example expression:pm.om. - visibilityFlag (
vf): Manages the visibility state of nodes. Helps refine user views and computation scopes. Example expressions:pm.vf false,pm.vf. - selected: Checks whether a node is selected without a short name. Example expressions:
pm.selected,not pm.selected.
Practical Example: Querying Hidden Nodes
Let’s say you are working with a large molecular system and need to identify all hidden property model nodes. You can achieve this with a simple query:
|
1 |
pm.h |
This expression will return true for all hidden nodes. To focus on nodes that are not hidden, you can use:
|
1 |
not pm.h |
This flexibility is a key advantage of using the propertyModel attributes.
Conclusion
The propertyModel attribute space in SAMSON NSL is a powerful tool for molecular modelers who want to efficiently organize, query, and control their node properties. By mastering these attributes, you can significantly improve the clarity and effectiveness of your molecular design workflows.
To learn more, visit the full official documentation at https://documentation.samson-connect.net/users/latest/nsl/propertyModel/.
SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON now from https://www.samson-connect.net.
