A quieter molecular workspace starts with knowing which notes you’re querying

Notes can be useful landmarks in a molecular model, but when a document contains many of them, finding the right note—or narrowing the set you want to inspect—can become a small but persistent distraction. The Node Specification Language (NSL) provides a way to describe notes by their attributes. Understanding the note-specific attribute space helps you write precise queries without confusing a note’s visibility, selection, or name with those of other node types.

Start with the note attribute space

In NSL, the attribute space for notes is note, with the short name nt. It matches only note nodes. That scope is useful: a query such as nt.v is about notes that are visible, rather than every visible node in the model.

The note attribute space inherits several attributes from the general node space. These include hidden, name, selected, selectionFlag, visibilityFlag, and visible. In practice, this means you can use familiar node properties while keeping the query focused on notes.

Useful starting queries

  • nt.v matches notes whose visible attribute is true; not nt.v expresses the opposite.
  • nt.selected matches selected notes; not nt.selected matches notes that are not selected.
  • nt.n "A" uses the note’s name attribute with a quoted string. The reference also lists nt.n "L*" as an example.
  • nt.h and not nt.h query the inherited hidden attribute.
  • nt.sf false and nt.vf false query the selection and visibility flags, respectively.

These examples make a good first step when you need to narrow attention to a particular kind of note. For instance, if you are checking which notes are currently visible, start with nt.v. If you need the notes that are not visible, use not nt.v. If your task is about selection instead, use nt.selected or its negated form.

Similar names do not mean identical attributes

One easy source of confusion is that the reference lists both visible and visibilityFlag, as well as both selected and selectionFlag. They are separate attributes with separate names and short names: visible is abbreviated as v, while visibilityFlag is vf; selectionFlag is sf, and selected has no short name in the note space.

So, use the attribute that matches the question you intend to ask. For visibility, the documented examples are nt.v and nt.vf false; for selection, they are nt.selected and nt.sf false. The reference identifies these as distinct inherited attributes, so it is best not to treat one as a substitute for the other without checking the relevant node documentation.

A simple way to build a reliable query

  1. Choose the scope. Use nt when you want the query to match notes only.
  2. Choose one attribute. Decide whether you are filtering by name, visibility, hidden state, or selection.
  3. Use the documented form. For example, start with nt.n "A" for a name-based query or not nt.selected for unselected notes.
  4. Check the result against your intent. If you meant to ask about the visibility flag rather than visibility itself, use the corresponding flag attribute instead.

Keeping the scope and attribute explicit makes NSL expressions easier to read later, especially when you return to a model after a break or share a query with a colleague. For the full attribute table and inherited-attribute references, see the SAMSON note attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.