I have this huge film database and there are lots of other custom types also and it would be great to link these together. But building a relation and manually creating the relation is out of the question. So I'm thinking of 2 possibilities here:
1. Somehow program the relation creation
2. "Fake relation", that is explained below.
Example case: connect the films and festivals.
Film CPT: film name (cpt title) + other fields
Festival performance CPT: film name (cpt title) + other fields
Now we have a film called "Promise" and it has 10 different festival performances. These are all called "Promise" and the slugs are promise-1, promise-2, and so on. Could this be somehow used here, like create a shortcode that strips the ending -xx from the slug and with this I could somehow create the link between the film and festival.
I'm guessing that the objective here is to do this once, for the existing content, to automatically create such connections, and that you would be happy to manually connect posts when new content is added?
In any case, the solution is largely the same, but it requires writing a custom PHP script that utilises the Relationships API to connect posts.
I can give you an outline of what is involved, but I can't write the code for you, so if you are not comfortable with PHP you will need to hire a developer (see https://toolset.com/contractors).
Your script would need to get all of the film posts and then iterate over them. For each film post you would want to search for festival performance posts with a matching slug. Because of limitations with WP_Query I think you would need to construct your own SQL query using the wpdb class for such a search (unless there are custom field values that would connect the film and festival performance posts rather than the slug).
Depending on how content is being added to your site, you could automate the process of creating connections using a similar technique, possibly triggered by the cred_save_data API hook if you are submitting content through front-end forms, or the save_post WordPress hook (https://developer.wordpress.org/reference/hooks/save_post/).