When a molecular scene contains many kinds of objects, it can be frustrating to narrow a search to files alone. A query intended for file nodes may be harder to reason about if you are unsure which attributes apply, how to refer to them, or whether a selection-related attribute is the one you meant.
SAMSON’s Node Specification Language (NSL) provides a dedicated file attribute space for this task. Its short name is fi, and it matches only file nodes. That gives you a useful starting point: prefix an attribute with fi when you want to express a condition about files rather than nodes in general.
Start with the file namespace
For example, the documented expression fi.n "A" uses the short form n for the inherited name attribute. The longer form of the attribute is name, so a name-based expression can also be written as fi.name "A". The page also shows fi.n "L*" as an example. In both cases, the value is written as a string in quotes.
Using the namespace explicitly can make a query easier to read later. When you revisit an expression, fi.n signals that the name condition is being applied to file nodes. This is especially helpful when you are assembling a longer expression or sharing it with a collaborator who needs to understand its scope quickly.
Be precise about selection attributes
The file attribute space includes both selected and selectionFlag. They are separate attributes, and the documentation lists different forms for each:
fi.selectedandnot fi.selectedexpress the selected condition in positive and negated forms.fi.sfandfi.sf falseusesf, the short name forselectionFlag.
A common source of confusion is assuming that similar-sounding selection terms are interchangeable. The reference lists them as distinct attributes, so choose the one that matches the condition you intend to express. The file page also notes that selected is inherited from node.selected, but does not have the short name s in the file attribute space. By contrast, selectionFlag is inherited from node.selectionFlag and keeps the short name sf.
A small query-reading checklist
Before using a file expression, check three things:
- Scope: Does it begin with
fi, so it targets file nodes? - Attribute: Are you checking
name,selected, orselectionFlag? - Value and form: Is a name supplied as a quoted string, and are you using the documented short name for the attribute?
These checks help prevent a small syntax choice from turning into a confusing search. For instance, if the goal is to express a condition based on a file’s name, use fi.n or fi.name with a quoted value. If the goal concerns selection, use the specific selection attribute rather than assuming that one selection-related name stands in for another.
The file reference is intentionally compact: it tells you which attributes are available in this namespace and points to the node attribute definitions they inherit. For the details behind those inherited attributes, consult the linked node attributes reference. You can also explore the NSL examples for additional expression patterns.
For the full attribute table and definitions, learn more in the file attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
