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

Created a temporary override in dataset type validator for datasets t… #790

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,6 @@ ENTITIES:
description: "The activity that was performed."
dataset_type:
before_create_trigger: set_publication_dataset_type
before_property_create_validators:
- validate_recognized_dataset_type
before_property_update_validators:
- validate_recognized_dataset_type
type: string
generated: true
immutable: true
Expand Down
3 changes: 2 additions & 1 deletion src/schema/schema_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def validate_recognized_dataset_type(property_key, normalized_entity_type, reque
# those square brackets are acceptable at the end of the string. Simply validate the start.
proposed_dataset_type_prefix = re.sub(pattern='(\S)\s\[.*\]$', repl=r'\1', string=new_data_dict['dataset_type'])
target_list = schema_manager.get_dataset_type_valueset_list()

# TODO This is a temporary bypass because the UBKG does not support publication as a dataset_type yet. Remove once its added
target_list.append("Publication")
if proposed_dataset_type_prefix not in target_list:
raise ValueError(f"Proposed Dataset dataset_type '{proposed_dataset_type_prefix}'"
f" is not recognized in the existing ontology."
Expand Down
Loading