Skip to content

Add script to generate basic sample data#45

Closed
jsvgoncalves wants to merge 4 commits intomainfrom
add-conceptschemes
Closed

Add script to generate basic sample data#45
jsvgoncalves wants to merge 4 commits intomainfrom
add-conceptschemes

Conversation

@jsvgoncalves
Copy link
Member

No description provided.

Signed-off-by: João Gonçalves <jsvgoncalves@gmail.com>
* Creating the concepts needs to be decouple from creating the
  concept_schemes, as concepts might need to be added to existing
  concept_schemes.

Signed-off-by: João Gonçalves <jsvgoncalves@gmail.com>
@jsvgoncalves jsvgoncalves requested review from cmutel and Copilot April 3, 2025 18:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new script that generates basic sample data for a semantic taxonomy by creating concept schemes and associated concepts using asynchronous API calls. Key changes include:

  • Implementation of functions to create multilingual strings, concept schemes, and concepts.
  • Integration with the pyst_client API for creating sample taxonomy data.
  • Command-line interface support for generating schemes, concepts, or both.
Comments suppressed due to low confidence (2)

scripts/create_sample_data.py:201

  • Consider using argparse.error() or sys.exit() to handle the missing '--scheme-id' scenario, ensuring that the error is clearly communicated and the program exits with a non-zero status.
print("Error: --scheme-id is required when creating concepts")

scripts/create_sample_data.py:22

  • [nitpick] The function name 'create_multilingual_string' suggests a single string, but it returns a list; consider renaming it to 'create_multilingual_strings' for improved clarity.
def create_multilingual_string(text_base: str, index: int) -> List[MultilingualString]:

@cmutel
Copy link
Contributor

cmutel commented Apr 4, 2025

Thanks @jsvgoncalves - feels like this should be a part of the pyst-client repo though? That isn't a dependency of the server yet.

If you agree I can move it over.

@jsvgoncalves
Copy link
Member Author

@cmutel just cherry-picked the commits to the other repo, PR at cauldron/pyst-client#2

@cmutel cmutel deleted the add-conceptschemes branch May 6, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants