1
SELECT fs.feature_id,
2
'Ontology_term'::text AS type,
3
CASE
4
WHEN ((db.name)::text ~~ '%Gene Ontology%'::text) THEN (('GO:'::text || (dbx.accession)::text))::character varying
5
WHEN ((db.name)::text ~~ 'Sequence Ontology%'::text) THEN (('SO:'::text || (dbx.accession)::text))::character varying
6
ELSE ((((db.name)::text || ':'::text) || (dbx.accession)::text))::character varying
7
END AS attribute
8
FROM cvterm s,
9
dbxref dbx,
10
feature_cvterm fs,
11
db
12
WHERE ((fs.cvterm_id = s.cvterm_id) AND (s.dbxref_id = dbx.dbxref_id) AND (db.db_id = dbx.db_id))
13
UNION ALL
14
SELECT fs.feature_id,
15
'Dbxref'::text AS type,
16
(((d.name)::text || ':'::text) || (s.accession)::text) AS attribute
17
FROM dbxref s,
18
feature_dbxref fs,
19
db d
20
WHERE ((fs.dbxref_id = s.dbxref_id) AND (s.db_id = d.db_id) AND ((d.name)::text <> 'GFF_source'::text))
21
UNION ALL
22
SELECT f.feature_id,
23
'Alias'::text AS type,
24
s.name AS attribute
25
FROM synonym s,
26
feature_synonym fs,
27
feature f
28
WHERE ((fs.synonym_id = s.synonym_id) AND (f.feature_id = fs.feature_id) AND ((f.name)::text <> (s.name)::text) AND (f.uniquename <> (s.name)::text))
29
UNION ALL
30
SELECT fp.feature_id,
31
cv.name AS type,
32
fp.value AS attribute
33
FROM featureprop fp,
34
cvterm cv
35
WHERE (fp.type_id = cv.cvterm_id)
36
UNION ALL
37
SELECT fs.feature_id,
38
'pub'::text AS type,
39
(((s.series_name)::text || ':'::text) || s.title) AS attribute
40
FROM pub s,
41
feature_pub fs
42
WHERE (fs.pub_id = s.pub_id)
43
UNION ALL
44
SELECT fr.subject_id AS feature_id,
45
'Parent'::text AS type,
46
parent.uniquename AS attribute
47
FROM feature_relationship fr,
48
feature parent
49
WHERE (fr.object_id = parent.feature_id)
50
UNION ALL
51
SELECT feature.feature_id,
52
'ID'::text AS type,
53
feature.uniquename AS attribute
54
FROM feature
55
WHERE (NOT (feature.type_id IN ( SELECT cvterm.cvterm_id
56
FROM cvterm
57
WHERE ((cvterm.name)::text = 'CDS'::text))))
58
UNION ALL
59
SELECT feature.feature_id,
60
'chado_feature_id'::text AS type,
61
(feature.feature_id)::character varying AS attribute
62
FROM feature
63
UNION ALL
64
SELECT feature.feature_id,
65
'Name'::text AS type,
66
feature.name AS attribute
67
FROM feature;