In a molecular modeling project, it is easy to lose time looking for a particular file—or to apply a search to the wrong kind of object. SAMSON’s Node Specification Language (NSL) provides a focused way to describe file nodes using their names and selection-related attributes. The key is to start in the right attribute space: fi.
Limit the search to file nodes
The file attribute space matches only file nodes. That makes it a useful starting point when your goal is to work with files rather than other nodes in a document. In NSL, the full attribute-space name is file, and its short name is fi. The examples below use that short form.
Search by name
To specify a file name, use the name attribute, or its short name, n. Values are written as strings in quotes. For example:
fi.n "A"fi.n "L*"
These examples show the two forms together: the file-node prefix and a quoted name value. The documentation includes both name and n; using the short form keeps an expression compact, while the full attribute name may be easier to recognize when you are learning or revisiting a query.
When a search does not behave as expected, check the basics first: does the expression begin with fi, is the attribute spelled correctly, and is the name value enclosed in quotes? Those small checks can help distinguish a query-format issue from a problem locating the file in a project.
Check selection-related attributes
File nodes also inherit the selected and selectionFlag attributes from the node attribute space. You can test selected directly, or negate it:
fi.selectednot fi.selected
For file nodes, selected does not have the short name s. That is a useful detail to remember if you have seen a shortened form elsewhere: the file reference lists the full attribute name here.
For selectionFlag, the short name is sf. The reference shows both a value-specific expression and an expression without an explicit value:
fi.sf falsefi.sf
The possible values listed for both selection-related attributes are true and false. Keeping the two attributes distinct in your query is helpful: the reference treats selected and selectionFlag as separate names, even though both are inherited from the node attribute space.
A quick query checklist
- Use
fiwhen you want to match file nodes. - Use
fi.norfi.namefor a name condition, with the value in quotes. - Use
fi.selectedornot fi.selectedto express the selected-state condition shown in the reference. - Use
fi.sffor theselectionFlagattribute, optionally specifyingtrueorfalse.
This compact set of attributes can make file-focused searches easier to read and check—especially when a project contains many different kinds of nodes. For the full attribute reference, see the SAMSON file attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
