Test htsworkflow under several different django & python versions
[htsworkflow.git] / encode_submission / annotations.sql
1 with
2   annotation as (
3   select
4     uri as annotation,
5     payload->>'description' as description,
6     jsonb_array_elements_text(payload->'files') as file
7   from item
8   where object_type = 'Annotation'
9   ),
10   file as (
11   select
12     uri as file,
13     payload->>'status' as status,
14     payload->>'file_type' as file_type,
15     payload->>'file_format' as file_format,
16     payload->>'output_type' as output_type,
17     payload->>'output_category' as category
18   from item
19   where object_type = 'File'
20   )
21 select annotation, description, file.file, status, file_type, file_format, category
22 from annotation
23      join file on annotation.file = file.file
24 where category != 'raw data'
25 ;