Skip to content

Commit

Permalink
Merge pull request #186 from CogStack/export-task-defs
Browse files Browse the repository at this point in the history
CU-86948qbfu: Add meta anno and relation defs for easier parsing duri…
  • Loading branch information
tomolopolis authored Apr 27, 2024
2 parents ed3b9f4 + eb428cc commit 2dffa57
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions webapp/api/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,23 @@ def retrieve_project_data(projects: QuerySet) -> Dict[str, List]:
"name": "<project_name" # name of the project
"id": "<id>" # the auto-generated id of the project (optional)
"cuis": ["cui_1", "cui_2" ... ] # the CUI filter for the project, includes those from file / and text-box
"meta_anno_defs": [
# list of meta annotation tasks configured for this project.
{
"name": "Name of meta annotation task",
"values": [
"<first value>",
"<second value>"
...
],
},
... more meta_annotation tasks configured for this project
],
"relation_anno_defs": [
"<name1>",
"<name2>"
... more relation annotation task names configured for this project
]
"documents": [
{
"id": "<id>" # the auto-generated id of the document (optional)
Expand Down Expand Up @@ -226,6 +243,9 @@ def retrieve_project_data(projects: QuerySet) -> Dict[str, List]:
out['cuis'] = project.cuis
out['project_status'] = project.project_status
out['project_locked'] = project.project_locked
out['meta_anno_defs'] = [{'name': t.name, 'values': [v.name for v in t.values.all()]}
for t in project.tasks.all()]
out['relation_anno_defs'] = [r.label for r in project.relations.all()]
out['documents'] = []

if project.cuis_file is not None and project.cuis_file:
Expand Down

0 comments on commit 2dffa57

Please sign in to comment.