is it possible to populate a primary key of a table based on a column of another table?
Sounds like a simple INSERT ... SELECT statement:
insert into target_table (the_pk_column)
select u.key
from regexp_split_to_table('12 5 7 19 30', '\s+') as u(key)
on conflict (the_pk_column) do nothing;

or based on the column of the source table
insert into target_table (the_pk_column)
select u.key
from source_table st
   cross join regexp_split_to_table(st.graph_path, '\s+') as u(key)
where st.id = ... --&lt;&lt; whatever you want to select
on conflict (the_pk_column) do nothing;