Agents simply match notes, creating an alias for each of those notes that match the query.
This has some errors, albeit ones which don’t likely affect the query as the first two terms use one opening but two closing parentheses.
$Tags(agent) doesn’t actually do anything pertinent. It just asks every note if the agent has a value for $Tags. If it does, each note will evaluate this as true and thus be a match. I think you meat to use:
though this will only work for an single value in the agent’s $Tag, because list.contains() can only match one list item. IOW, you can match ‘oranges’ but not ‘oranges’ and ‘pears’. This is because in the latter case you’d need to write this to match either of 2 tag values:
if you wanted to match 3 values, you’d need a third query term, etc. IOW, you can’t (easily) make the query auto-expand to accommodate varying amounts of agent $Tags values.
A much better approach is to use Attribute browser for this sort of task as it can list each combiation of $Tags values. A note with $Tags values of ‘oranges’ and ‘pears’ will list under, 'o
If I understand correctly you want to match certain tags, but only for those notes that are only children of your agent at container
This doesn’t really need a new agent. You just add some terms onto your original query:
$Location.contains($Location(agent)) & $CitationKey==$CitationKey(agent) & $Tags.icontains(“reseña[a-zA-ZÀ-ÿ0-9_-]+”)
- Set-type attributes
list.icontains() NB for matching list-based (i.e. Set, List types) values your regex pattern must match complete values and not just the desired sub-string. This may be a simple as a bit of padding with
.* at each end of the regex pattern.