When a molecular project contains many files, a small selection mistake can waste time: you may be trying to identify a file node but instead be thinking about the molecular objects inside it. SAMSON’s Node Specification Language (NSL) lets you make the target explicit. The file attribute space, abbreviated fi, matches file nodes only.
That distinction is useful whenever your task is about the files represented in the document tree: finding a file by name, checking whether a file node is selected, or querying its selection flag. Starting with fi makes the intended node type visible in the expression rather than leaving it implicit.
Start with a file name
The inherited name attribute can be written as fi.name or with its short name, fi.n. Name values are strings in quotes. For example:
fi.n "A"uses the name stringA.fi.n "L*"uses the example stringL*.
Keeping the value quoted is an easy detail to overlook when writing a specification. The documentation lists both examples, but does not define the matching behavior of the asterisk here, so treat "L*" as a documented example rather than assuming additional pattern rules from this page alone.
Check selection explicitly
File nodes inherit the selected attribute, but unlike some node attributes, it has no short name in the file attribute space. The documented forms are:
fi.selectedfor the selected state.not fi.selectedfor the opposite state.
This can help make a query easier to read later: the expression says both that it concerns file nodes and that selection state matters. Don’t substitute a shortened form such as fi.s based on another node attribute space; the file reference specifically says selected is available here without the short name s.
Keep selectionFlag separate
The inherited selectionFlag attribute has the short name sf. Its documented examples are fi.sf and fi.sf false. Both selected and selectionFlag are boolean attributes, but they are listed as distinct attributes. If your task calls for one of them, use that attribute’s actual name or documented short name instead of treating the two labels as interchangeable.
A quick way to avoid scope errors
- Ask what kind of node you mean. If it is a file node, begin with
fi. - Choose the relevant attribute:
nfor the name,selectedfor selected state, orsffor selectionFlag. - Use the documented value form: quoted strings for names and boolean values where applicable.
- Check the expression against the intended question before using it in a larger workflow.
This small habit—making the node type and attribute explicit—can make specifications easier to inspect, reuse, and troubleshoot. For the complete file attribute reference, see the SAMSON file attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
