In PyBIDS we have the idea of layout.get(desc=Query.REQUIRED) (where desc is an arbitrarily selected entity) that indicates that any non-null value is permitted. Query.OPTIONAL permits the value to be present or absent. Query.NONE only matches files do not have that entity.
These queries should be translated to ANCP equivalents.