Interoperability between Org Roam and regular Org

I’d like to go the other way; I have a giant org file I’d like to port:

OneGiantOrgFile --> org-roam.

Has anyone written something doing that? My big org file has the usual org-mode outline hierarchy, so I’d love to see how other people have mapped an outline into small org-roam notes.

But in addition, my big org file has a bunch of manually created links. For these, the thing being linked to is always a dedicated target with some unique, usually meaningful name, either in text:

Clicking on a link brings you here: <<targetName>>

or on a headline like so:

** <<targetName>>

or like so:

** Some text <<targetName>>

The referencing side of the link is an internal link, either on a headline or in ordinary text:

** [[targetName]]
** another headline
   This is a reference with a description: [[targetName][targetDescription]]

When the <<targetName>> is in text, the text around it could be turned into a separate org-roam note, possibly including the headline above it (if it also doesn’t contain a dedicated target) and any headlines underneath it. If the stuff underneath it contains a <<targetName>>, then this doesn’t have to be in a separate note, but could be somehow linked to from other notes.

When the <<targetName>> is on a headline, the headline and everything underneath it could become a separate org-roam note.

Any suggestions for where to start?