Knowledge-Graph-Hub / kg-obo

A package to transform all OBO ontologies into KGX TSV format and OBO json, and put the transformed graph in KGhub
https://knowledge-graph-hub.github.io/kg-obo/getting_started.html
GNU General Public License v3.0
28 stars 2 forks source link

Add option to overwrite existing transform files on KG-OBO #182

Closed caufieldjh closed 2 years ago

justaddcoffee commented 2 years ago

Is this not harmful? In theory, this will allow the code to overwrite any file in KG-Hub, so a given URL is not guaranteed to contain the same content from one day to the next

caufieldjh commented 2 years ago

True! This is here so I can replace all the most recent transforms with their node-normalized versions, and that shouldn't need to happen under usual conditions.

justaddcoffee commented 2 years ago

Ah okay. What I've done in the past is to manually fix any files that have been uploaded to S3 that need to changed - if that's not possible, it may be a good idea to at least create a flag (--force or something like that) that permits overwriting files and is off by default

Thoughts?

caufieldjh commented 2 years ago

...create a flag (--force or something like that) that permits overwriting files...

You read my mind! That will go in this PR.

justaddcoffee commented 2 years ago

+1

justaddcoffee commented 2 years ago

Adding: this overwriting still seems a bit dangerous to me, but if it's off by default I guess that limits the danger a bit

caufieldjh commented 2 years ago

I'll agree that it does feel icky. I should probably include a failsafe to restrict this to the most recent KG-OBO transform, so the archival versions are retained in the event of unintentional overwriting

caufieldjh commented 2 years ago

I should probably include a failsafe

Looks like I already included this https://github.com/Knowledge-Graph-Hub/kg-obo/blob/3b0cc821044cd135532e62355b770fd6c310744b/kg_obo/transform.py#L906-L918