Updating Relationships viaFilter or via deep url?

I’ve got a 3 way association, (an associative table in the database) and looking to update one of these associations where another association exists. for json:api , would either of the following or both fit in terms of the url structure?

/foos/{id}/bars/relationships/tags/'

/foos/{id}/relationships/tags?filter[bar_id]={bar_id}

This is not clear to me. Could you provide more details?

As /foos/{id}/bars/relationships/tags/ would list, add, replace and delete tag associations with foos,

where a tag is associated with a foo, there is an intermediary database table with a none nullable value that points to a third association, such that for every foo - tag association, there MUST also be an association with bars.

The spec does not mention deep nested urls, and in adition to the standard root uri’s would the following be valid uri’s?

/foos/{id}/bars/relationships/tags/
/foos/{id}/relationships/tags?filter[bar_id]={bar_id}

Another option being to use a custom extension and send a different format