Associate two tracks as the same composition using file tags. i.e "prefer file" for work id?

Is there a way, by tagging the audio files, to associate two files as the same composition?
It seems that once Roon identify an album, there’s no way to correct the composition ID using tags, so if Roon’s data sources have incorrect work ids, this cannot be corrected using tags.

For example:
I have the same song in a studio album and in a live album by the same artist. The tags are the same for both songs (Artist, Composer, Lyricist).
Roon identify the albums correctly but incorrectly identify the tracks as different compositions because the data source (musicbrainz) has different “work ids” for the tracks.
I’ve tried setting WORK and WORKID to the same value for both tracks, but Roon seems to ignore these tags for single-part composition (i.e not classical music).
Even if I set everything in “Setting” → “Library” → “Import Settings” to “Prefer file”, I still cannot get Roon to associate the two tracks as being the same composition.

If I tell Roon to not identify the albums (“None of these look right”), the track will get associated correctly as the same composition (Because Roon falls back to “Title” and “Composer” tags association). Obviously I then lose all other Valance metadata and goodies.

Is there really no way to have “prefer file” for composition id? This seems like a big oversight.

Yes
In My Library - Compositions layout:
Select “Show all compositions”
Use the filters to locate the compositions in question.
Highlight both
Click on “Merge compositions” (top right)

Thanks for the suggestion but I have 100,000 tracks so it would take an army to accomplish this manually. I need a way to do it by tagging the audio files so I could use a batch editor like Yate or Metadatics or write a script to update the tags on all my files. Roon should have an option to allow users to use their file tags for “works” (composition), by adding a “prefer file” option for WORK / WORKID tags.

Alternatively, a new option could be added: “use title / composer only for composition matching” - and when selected Roon will ignore musicbrainz work ids, and will only use the track’s title and composer to match compositions.

The concept of ‘Composition’ (irrespective of how many tracks it splits over) is a key concept in considering music. Roon deserves full credit for having a composition table and cataloguing music this way.
However, the implementation leaves a lot to be desired. It’s current algorithm will link compositions based on the album being recognise. Compositions in unrecognised albums will separately match their compositions based solely on the work (and composer) fields. No attempt is made to match this with ‘known’ compositions. (Unfortunately this also applies to Album artists which are not a “Primary performer”.) The option to “prefer file data” in editing compositions does not work and is known to have not worked for some time.
See Editing Composition data
and Title and Composition issue
Even if you do update all your tags correctly (I have a custom database with Yate) they will be politely read, displayed, and otherwise left alone.

Thanks Ralph. I appreciate your help. Kinda sucks that a “music lovers” app insists on not allowing me to use my file tags. Especially in this case, where musicbrainz database is full of duplicated works.

I guess I’ll have to look into scripting something to edit the corresponding releases on musicbrainz automatically.

Welcome
The musicbrainz cleanup will only apply if the album is identified and is in Musicbrainz.
About 20% of my 4300 albums are not identified so some form of manual linking with known compositions, artists etc is still required.
It is, as you say, kinda sucks, that Roon cannot (does not attempt to) link by using file tag data.