Skip to content

Commit

Permalink
Merge pull request #41 from kaiwenho/main
Browse files Browse the repository at this point in the history
Added script to generate a json containing the sources currently used by Unsecret
  • Loading branch information
sierra-moxon authored Oct 28, 2024
2 parents 85f4593 + 76ee8bb commit 11b2932
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"infores:unsecret-agent": [
"infores:robokop-kg",
"infores:text-mining-provider-targeted",
"infores:rtx-kg2"
]
}
24 changes: 24 additions & 0 deletions src/information_resource_registry/translator_dataflow/unsecret.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import requests
import yaml
import json

def main():
infores_dict = {'infores:unsecret-agent': []}

url = "https://raw.githubusercontent.com/webyrd/mediKanren/refs/heads/master/medikanren2/neo/neo-open-api/unsecret-source-consume.yaml"
response = requests.get(url)

if response.status_code == 200:
knowledge_sources = yaml.safe_load(response.content)

for curie, infores_curie in knowledge_sources.items():
infores_dict['infores:unsecret-agent'].append(infores_curie['infores_curie'])
else:
print(f"Error downloading file: {response.status_code}")
exit()

json.dump(infores_dict, open('data/unsecret.json', 'w'), indent=2, sort_keys=True)

# Call main() if this script is executed directly
if __name__ == "__main__":
main()

0 comments on commit 11b2932

Please sign in to comment.