Skip to content

Commit

Permalink
Merge pull request #264 from sennetconsortium/maxsibilla/ingest-metadata
Browse files Browse the repository at this point in the history
Maxsibilla/ingest metadata
  • Loading branch information
maxsibilla authored Jan 19, 2024
2 parents a8de913 + 98b72ec commit 04347f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.1
1.4.2
2 changes: 1 addition & 1 deletion entity-api-spec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
description: 'The SenNet Entity API is a standard RESTful web service with create, update and read operations for the standard SenNet provenance graph entities.'
version: 1.4.1
version: 1.4.2
title: SenNet Entity API
contact:
name: SenNet Help Desk
Expand Down
9 changes: 2 additions & 7 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4601,10 +4601,9 @@ def check_for_metadata(entity_type, user_token):
# Parse incoming json string into json data(python dict object)
json_data_dict = request.get_json()

# Convert `ingest_metadata` from pipeline to `metadata`
# ingest_metadata only exists on Datasets and we do not currently validate that
if 'ingest_metadata' in json_data_dict:
json_data_dict['metadata'] = json_data_dict['ingest_metadata']
del json_data_dict['ingest_metadata']
return json_data_dict

if 'metadata' in json_data_dict:
# If metadata is empty then just proceed. The portal is more than likely trying to reset this intentionally
Expand All @@ -4614,10 +4613,6 @@ def check_for_metadata(entity_type, user_token):
if isinstance(json_data_dict['metadata'], list):
json_data_dict['metadata'] = json_data_dict['metadata'][0]

# TODO: add a validation check (validate_metadata). For now we want this to accept pipeline Dataset metadata
if entity_type == 'Dataset':
return json_data_dict

if json_data_dict['metadata']:
file_row = json_data_dict['metadata'].get('file_row')
if 'pathname' in json_data_dict['metadata']:
Expand Down
3 changes: 3 additions & 0 deletions src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ ENTITIES:
pipeline_message:
# Generated from the Ingest Pipeline during processing of a derived dataset
type: string
ingest_metadata:
type: json_string # dict
description: "The metadata returned from the processing at data submission time."
local_directory_rel_path:
# Example: protected/<TMC>/<uuid>
type: string
Expand Down

0 comments on commit 04347f0

Please sign in to comment.