Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to split and join metadata for multiple tables #54

Open
chrwm opened this issue Jun 22, 2022 · 4 comments
Open

Function to split and join metadata for multiple tables #54

chrwm opened this issue Jun 22, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@chrwm
Copy link
Member

chrwm commented Jun 22, 2022

A function would come in handy to split and join metadata from existing tables.

1st use-case: 1 metadata string with multiple tables in key resources. Create one metadata string for each resource and copy the general information to each individual new resource-metadata-string.

2nd use-case: reverse 1st use-case

@chrwm chrwm added the enhancement New feature or request label Jun 22, 2022
@chrwm chrwm self-assigned this Jun 22, 2022
@jh-RLI
Copy link
Contributor

jh-RLI commented Jun 30, 2022

To make it clearer, you want a function that can add the metadata to any table referenced in the resources?

We can also use omi to 1. read the JSON string and create a python OEMetadata object (parse) 2. Modify the object parsed.key.value = new.value and then 3. compile, render and save the Object back to a JSON file. I added a simple usaage section to provide an example.

In general i think we maybe should not add this functionality to ´omi´ but to an other tool like the ´oep-client´.

@chrwm
Copy link
Member Author

chrwm commented Jul 5, 2022

@Ludee and I were speaking about it.

To make it clearer, you want a function that can add the metadata to any table referenced in the resources?

For example, 1 metadata json that has 5 different tables in the resources should be split in 5 metadata jsons that have respectively 1 individual table in the resources. Each table inherites the general information too.

We can also use omi to 1. read the JSON string and create a python OEMetadata object (parse) 2. Modify the object parsed.key.value = new.value and then 3. compile, render and save the Object back to a JSON file. I added a simple usaage section to provide an example.

This seems to be about the functionality I described.

@Ludee what do you think

@jh-RLI
Copy link
Contributor

jh-RLI commented Jul 5, 2022

Thanks for the explanation :) Also to clarify my point: I think it is not necessary to create 5 new metadata files. We can also just add the same json to all the tables, but cut out the resource keys that don't belong to the "current" table.
Also, I think it will be problematic to split the source information when the resources are split, since we still have no way to identify the table a source refers to (or am I missing something?).

@chrwm
Copy link
Member Author

chrwm commented Jul 6, 2022

I think it is not necessary to create 5 new metadata files. We can also just add the same json to all the tables, but cut out the resource keys that don't belong to the "current" table.

That's also a feasible approach, which should yield the same result, I think.

I think it will be problematic to split the source information when the resources are split, since we still have no way to identify the table a source refers to (or am I missing something?)

I agree for some use-cases this will be a problem. @Ludee and I thought had the open-mastr use-case in mind, where one only has one source and a variety of possible table outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants