When a molecular project contains many files, a small mistake in a filter can make it harder to find the structure or supporting file you need. SAMSON’s Node Specification Language (NSL) provides a way to describe file nodes using attributes such as their names and selection state. The key is to be explicit about what you want to match—and about which kind of node you are matching.
Start by limiting the search to files
File attributes belong to the file attribute space, abbreviated fi. This space matches only file nodes. That makes fi a useful starting point when your task is specifically about files rather than other nodes in a molecular scene.
For example, the documented expression fi.n "A" uses the short name n for the inherited name attribute. The example fi.n "L*" shows another name expression. If you are adapting an expression to your own project, begin with a simple name and then adjust it to the naming pattern you need.
Use the short form—or the full attribute name
The reference lists both attribute names and short names. For a file’s name, you can use fi.n. For its selection flag, the short form is fi.sf. Short forms can make repeated expressions compact, while full names can be easier to scan when you are learning or reviewing a query.
For instance, these documented forms refer to the selection flag:
fi.sffi.selectionFlag
The selected attribute is also available for file nodes, but this file attribute space does not provide the short name s for it. Its examples are fi.selected and not fi.selected. When writing a file-focused expression, use the explicit form rather than assuming that a short name available elsewhere also applies here.
Check the attribute before changing the expression
When a query does not match what you expect, troubleshoot it in small steps:
- Confirm the node type. The
fiprefix is for file nodes. If you intend to match a different kind of node, a file attribute expression is not the right scope. - Check the attribute spelling. The reference lists
name,selected, andselectionFlagfor this space. - Use the documented short names carefully.
nandsfare listed;selectedhas no short name here. - Separate name matching from selection checks. Start with a name expression such as
fi.n "A", then add a selection condition only if it is relevant to your task.
One important detail is that selected and selectionFlag are listed as separate attributes. The file reference does not explain their behavioral differences, so avoid treating them as interchangeable based on their names alone. If the distinction matters for your workflow, consult the linked definitions for the inherited node attributes.
A practical way to build a file query
Think of a query as a focused description: first specify that you are looking for file nodes, then choose the attribute that answers your question. Use fi.n "A" when you are expressing a name condition. Use fi.selected or not fi.selected when your condition concerns the selected state. Use fi.sf when you specifically mean the selection flag. Keeping these intentions distinct makes expressions easier to inspect and revise.
For the complete attribute reference, see the SAMSON file attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
