Skip to content

Commit fa22f4a

Browse files
authored
Merge pull request #102 from mcwdsi/issue-101
edited SQL scripts and templates to fix multiple label issues on dis…
2 parents 2235749 + e9b811c commit fa22f4a

File tree

3 files changed

+46
-36
lines changed

3 files changed

+46
-36
lines changed

src/scripts/convert-dron-ldtab.sql

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,16 @@ SELECT
156156
'xsd:string' AS datatype
157157
FROM (
158158
SELECT curie, label FROM dron.ingredient
159-
UNION
160-
SELECT curie, label FROM dron.disposition
159+
);
160+
161+
INSERT OR IGNORE INTO dron_ingredient(subject, predicate, object, datatype)
162+
SELECT
163+
curie as subject,
164+
'rdfs:label' as predicate,
165+
label as object,
166+
datatype as datatype
167+
FROM (
168+
SELECT curie, label, datatype FROM dron.disposition
161169
);
162170

163171
-- Assert DRON:00010000 'has_RxCUI' annotation.
@@ -283,7 +291,7 @@ INSERT INTO dron_rxnorm VALUES
283291
(1, 0, 'graph', '<http://purl.obolibrary.org/obo/BFO_0000051>', 'rdf:type', 'owl:TransitiveProperty', '_IRI', NULL),
284292
(1, 0, 'graph', '<http://purl.obolibrary.org/obo/BFO_0000051>', 'rdfs:label', 'has part', 'xsd:string', NULL),
285293
(1, 0, 'graph', 'RO:0000053', 'rdf:type', 'owl:ObjectProperty', '_IRI', NULL),
286-
(1, 0, 'graph', 'RO:0000053', 'rdfs:label', 'is_bearer_of', 'xsd:string', NULL),
294+
(1, 0, 'graph', 'RO:0000053', 'rdfs:label', 'is bearer of', '@en', NULL),
287295
(1, 0, 'graph', 'DRON:00000005', 'rdf:type', 'owl:Class', '_IRI', NULL),
288296
(1, 0, 'graph', 'DRON:00000015', 'rdf:type', 'owl:Class', '_IRI', NULL),
289297
(1, 0, 'graph', 'DRON:00000017', 'rdf:type', 'owl:Class', '_IRI', NULL),
@@ -295,15 +303,15 @@ INSERT INTO dron_rxnorm VALUES
295303
(1, 0, 'graph', 'DRON:00000024', 'rdf:type', 'owl:Class', '_IRI', NULL),
296304
(1, 0, 'graph', 'DRON:00000026', 'rdf:type', 'owl:Class', '_IRI', NULL),
297305
(1, 0, 'graph', 'DRON:00000032', 'rdf:type', 'owl:Class', '_IRI', NULL),
298-
(1, 0, 'graph', 'DRON:00000033', 'rdfs:label', 'anti-malarial function of a drug product', 'xsd:string', NULL),
299-
(1, 0, 'graph', 'DRON:00000034', 'rdfs:label', 'anti-hypertensive function of a drug product', 'xsd:string', NULL),
300-
(1, 0, 'graph', 'DRON:00000035', 'rdfs:label', 'analgesic function of a drug product', 'xsd:string', NULL),
306+
(1, 0, 'graph', 'DRON:00000033', 'rdfs:label', 'anti-malarial function', '@en', NULL),
307+
(1, 0, 'graph', 'DRON:00000034', 'rdfs:label', 'anti-hypertensive function', '@en', NULL),
308+
(1, 0, 'graph', 'DRON:00000035', 'rdfs:label', 'analgesic function', '@en', NULL),
301309
(1, 0, 'graph', 'DRON:00010000', 'rdf:type', 'owl:AnnotationProperty', '_IRI', NULL),
302310
(1, 0, 'graph', 'DRON:00010000', 'rdfs:label', 'has_RxCUI', 'xsd:string', NULL);
303311

304312
-- Assert rdf:type is owl:Class
305313
-- for all clinical drug form, clinical drug, and branded drug
306-
-- and dispositions in clinical_dru_form_disposition rows.
314+
-- and dispositions in clinical_drug_form_disposition rows.
307315
INSERT INTO dron_rxnorm(subject, predicate, object)
308316
SELECT
309317
curie AS subject,
@@ -321,21 +329,21 @@ FROM (
321329

322330
-- Assert rdfs:label annotation
323331
-- for all clinical drug form, clinical drug, and branded drug
324-
-- and dispositions in clinical_dru_form_disposition rows.
332+
-- and dispositions in clinical_drug_form_disposition rows.
325333
INSERT INTO dron_rxnorm(subject, predicate, object, datatype)
326334
SELECT
327335
curie AS subject,
328336
'rdfs:label' AS predicate,
329337
label AS object,
330-
'xsd:string' AS datatype
338+
datatype
331339
FROM (
332-
SELECT curie, label FROM dron.clinical_drug_form
340+
SELECT curie, label, 'xsd:string' AS datatype FROM dron.clinical_drug_form
333341
UNION
334-
SELECT curie, label FROM dron.clinical_drug
342+
SELECT curie, label, 'xsd:string' AS datatype FROM dron.clinical_drug
335343
UNION
336-
SELECT curie, label FROM dron.branded_drug
344+
SELECT curie, label, 'xsd:string' AS datatype FROM dron.branded_drug
337345
UNION
338-
SELECT d.curie, d.label
346+
SELECT d.curie, d.label, d.datatype
339347
FROM dron.clinical_drug_form_disposition AS cdfd
340348
LEFT JOIN dron.disposition AS d
341349
WHERE cdfd.disposition = d.curie

src/scripts/create-dron-tables.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ CREATE TABLE rxcui (
77

88
CREATE TABLE disposition (
99
curie TEXT PRIMARY KEY,
10-
label TEXT UNIQUE NOT NULL
10+
label TEXT UNIQUE NOT NULL,
11+
datatype TEXT NOT NULL
1112
);
1213

1314
CREATE TABLE ingredient (

src/templates/disposition.tsv

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
curie label
2-
DRON:00000033 anti-malarial function
3-
DRON:00000034 anti-hypertensive function
4-
DRON:00000035 analgesic function
5-
DRON:00000036 function-inhibiting mu receptor binding disposition
6-
DRON:00000037 function-activating mu receptor binding disposition
7-
DRON:00000038 function-inhibiting delta receptor binding disposition
8-
DRON:00000039 function-activating delta receptor binding disposition
9-
DRON:00000040 function-inhibiting kappa receptor binding disposition
10-
DRON:00000041 function-activating kappa receptor binding disposition
11-
DRON:00020323 non-activating competitive beta-adrenergic receptor binding disposition
12-
DRON:00020324 function-inhibiting hydrogen/potassium adenosine triphosphatase enzyme (H+/K+ ATPase) binding disposition
13-
DRON:00020325 function-inhibiting L-type voltage-gated calcium channel binding disposition
14-
DRON:00020326 function-inhibiting vitamin K epoxide reductase binding disposition
15-
DRON:00020327 function-inhibiting Na-K-Cl cotransporter 2 (NKCC2) binding disposition
16-
DRON:00020328 function-inhibiting T-type calcium channel binding disposition
17-
DRON:00698710 function-inhibiting cytochrome P450 2C19 (CYP2C19) binding disposition
18-
DRON:00723853 function-inhibiting angiotensin-converting enzyme binding disposition
19-
DRON:00723854 function-inhibiting cytochrome P450 2D6 (CYP2D6) binding disposition
20-
DRON:00723855 cytochrome P450 isoenzyme 2C19 (CYP2C19) substrate disposition
21-
DRON:00723856 cytochrome P450 isoenzyme 2D6 (CYP2D6) substrate disposition
22-
DRON:00724207 function-inhibiting angiotensin receptor binding disposition
1+
curie label datatype
2+
DRON:00000033 anti-malarial function @en
3+
DRON:00000034 anti-hypertensive function @en
4+
DRON:00000035 analgesic function @en
5+
DRON:00000036 function-inhibiting mu receptor binding disposition @en
6+
DRON:00000037 function-activating mu receptor binding disposition @en
7+
DRON:00000038 function-inhibiting delta receptor binding disposition @en
8+
DRON:00000039 function-activating delta receptor binding disposition @en
9+
DRON:00000040 function-inhibiting kappa receptor binding disposition @en
10+
DRON:00000041 function-activating kappa receptor binding disposition @en
11+
DRON:00000059 function-inhibiting sodium-chloride cotransporter binding disposition @en
12+
DRON:00020323 non-activating competitive beta-adrenergic receptor binding disposition @en
13+
DRON:00020324 function-inhibiting hydrogen/potassium adenosine triphosphatase enzyme (H+/K+ ATPase) binding disposition @en
14+
DRON:00020325 function-inhibiting L-type voltage-gated calcium channel binding disposition @en
15+
DRON:00020326 function-inhibiting vitamin K epoxide reductase binding disposition @en
16+
DRON:00020327 function-inhibiting Na-K-Cl cotransporter 2 (NKCC2) binding disposition @en
17+
DRON:00020328 function-inhibiting T-type calcium channel binding disposition @en
18+
DRON:00698710 function-inhibiting cytochrome P450 2C19 (CYP2C19) binding disposition @en
19+
DRON:00723853 function-inhibiting angiotensin-converting enzyme binding disposition @en
20+
DRON:00723854 function-inhibiting cytochrome P450 2D6 (CYP2D6) binding disposition @en
21+
DRON:00723855 cytochrome P450 isoenzyme 2C19 (CYP2C19) substrate disposition @en
22+
DRON:00723856 cytochrome P450 isoenzyme 2D6 (CYP2D6) substrate disposition @en
23+
DRON:00724207 function-inhibiting angiotensin receptor binding disposition @en

0 commit comments

Comments
 (0)