Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions src/scripts/convert-dron-ldtab.sql
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,16 @@ SELECT
'xsd:string' AS datatype
FROM (
SELECT curie, label FROM dron.ingredient
UNION
SELECT curie, label FROM dron.disposition
);

INSERT OR IGNORE INTO dron_ingredient(subject, predicate, object, datatype)
SELECT
curie as subject,
'rdfs:label' as predicate,
label as object,
datatype as datatype
FROM (
SELECT curie, label, datatype FROM dron.disposition
);

-- Assert DRON:00010000 'has_RxCUI' annotation.
Expand Down Expand Up @@ -283,7 +291,7 @@ INSERT INTO dron_rxnorm VALUES
(1, 0, 'graph', '<http://purl.obolibrary.org/obo/BFO_0000051>', 'rdf:type', 'owl:TransitiveProperty', '_IRI', NULL),
(1, 0, 'graph', '<http://purl.obolibrary.org/obo/BFO_0000051>', 'rdfs:label', 'has part', 'xsd:string', NULL),
(1, 0, 'graph', 'RO:0000053', 'rdf:type', 'owl:ObjectProperty', '_IRI', NULL),
(1, 0, 'graph', 'RO:0000053', 'rdfs:label', 'is_bearer_of', 'xsd:string', NULL),
(1, 0, 'graph', 'RO:0000053', 'rdfs:label', 'is bearer of', '@en', NULL),
(1, 0, 'graph', 'DRON:00000005', 'rdf:type', 'owl:Class', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00000015', 'rdf:type', 'owl:Class', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00000017', 'rdf:type', 'owl:Class', '_IRI', NULL),
Expand All @@ -295,15 +303,15 @@ INSERT INTO dron_rxnorm VALUES
(1, 0, 'graph', 'DRON:00000024', 'rdf:type', 'owl:Class', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00000026', 'rdf:type', 'owl:Class', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00000032', 'rdf:type', 'owl:Class', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00000033', 'rdfs:label', 'anti-malarial function of a drug product', 'xsd:string', NULL),
(1, 0, 'graph', 'DRON:00000034', 'rdfs:label', 'anti-hypertensive function of a drug product', 'xsd:string', NULL),
(1, 0, 'graph', 'DRON:00000035', 'rdfs:label', 'analgesic function of a drug product', 'xsd:string', NULL),
(1, 0, 'graph', 'DRON:00000033', 'rdfs:label', 'anti-malarial function', '@en', NULL),
(1, 0, 'graph', 'DRON:00000034', 'rdfs:label', 'anti-hypertensive function', '@en', NULL),
(1, 0, 'graph', 'DRON:00000035', 'rdfs:label', 'analgesic function', '@en', NULL),
(1, 0, 'graph', 'DRON:00010000', 'rdf:type', 'owl:AnnotationProperty', '_IRI', NULL),
(1, 0, 'graph', 'DRON:00010000', 'rdfs:label', 'has_RxCUI', 'xsd:string', NULL);

-- Assert rdf:type is owl:Class
-- for all clinical drug form, clinical drug, and branded drug
-- and dispositions in clinical_dru_form_disposition rows.
-- and dispositions in clinical_drug_form_disposition rows.
INSERT INTO dron_rxnorm(subject, predicate, object)
SELECT
curie AS subject,
Expand All @@ -321,21 +329,21 @@ FROM (

-- Assert rdfs:label annotation
-- for all clinical drug form, clinical drug, and branded drug
-- and dispositions in clinical_dru_form_disposition rows.
-- and dispositions in clinical_drug_form_disposition rows.
INSERT INTO dron_rxnorm(subject, predicate, object, datatype)
SELECT
curie AS subject,
'rdfs:label' AS predicate,
label AS object,
'xsd:string' AS datatype
datatype
FROM (
SELECT curie, label FROM dron.clinical_drug_form
SELECT curie, label, 'xsd:string' AS datatype FROM dron.clinical_drug_form
UNION
SELECT curie, label FROM dron.clinical_drug
SELECT curie, label, 'xsd:string' AS datatype FROM dron.clinical_drug
UNION
SELECT curie, label FROM dron.branded_drug
SELECT curie, label, 'xsd:string' AS datatype FROM dron.branded_drug
UNION
SELECT d.curie, d.label
SELECT d.curie, d.label, d.datatype
FROM dron.clinical_drug_form_disposition AS cdfd
LEFT JOIN dron.disposition AS d
WHERE cdfd.disposition = d.curie
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/create-dron-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ CREATE TABLE rxcui (

CREATE TABLE disposition (
curie TEXT PRIMARY KEY,
label TEXT UNIQUE NOT NULL
label TEXT UNIQUE NOT NULL,
datatype TEXT NOT NULL
);

CREATE TABLE ingredient (
Expand Down
45 changes: 23 additions & 22 deletions src/templates/disposition.tsv
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
curie label
DRON:00000033 anti-malarial function
DRON:00000034 anti-hypertensive function
DRON:00000035 analgesic function
DRON:00000036 function-inhibiting mu receptor binding disposition
DRON:00000037 function-activating mu receptor binding disposition
DRON:00000038 function-inhibiting delta receptor binding disposition
DRON:00000039 function-activating delta receptor binding disposition
DRON:00000040 function-inhibiting kappa receptor binding disposition
DRON:00000041 function-activating kappa receptor binding disposition
DRON:00020323 non-activating competitive beta-adrenergic receptor binding disposition
DRON:00020324 function-inhibiting hydrogen/potassium adenosine triphosphatase enzyme (H+/K+ ATPase) binding disposition
DRON:00020325 function-inhibiting L-type voltage-gated calcium channel binding disposition
DRON:00020326 function-inhibiting vitamin K epoxide reductase binding disposition
DRON:00020327 function-inhibiting Na-K-Cl cotransporter 2 (NKCC2) binding disposition
DRON:00020328 function-inhibiting T-type calcium channel binding disposition
DRON:00698710 function-inhibiting cytochrome P450 2C19 (CYP2C19) binding disposition
DRON:00723853 function-inhibiting angiotensin-converting enzyme binding disposition
DRON:00723854 function-inhibiting cytochrome P450 2D6 (CYP2D6) binding disposition
DRON:00723855 cytochrome P450 isoenzyme 2C19 (CYP2C19) substrate disposition
DRON:00723856 cytochrome P450 isoenzyme 2D6 (CYP2D6) substrate disposition
DRON:00724207 function-inhibiting angiotensin receptor binding disposition
curie label datatype
DRON:00000033 anti-malarial function @en
DRON:00000034 anti-hypertensive function @en
DRON:00000035 analgesic function @en
DRON:00000036 function-inhibiting mu receptor binding disposition @en
DRON:00000037 function-activating mu receptor binding disposition @en
DRON:00000038 function-inhibiting delta receptor binding disposition @en
DRON:00000039 function-activating delta receptor binding disposition @en
DRON:00000040 function-inhibiting kappa receptor binding disposition @en
DRON:00000041 function-activating kappa receptor binding disposition @en
DRON:00000059 function-inhibiting sodium-chloride cotransporter binding disposition @en
DRON:00020323 non-activating competitive beta-adrenergic receptor binding disposition @en
DRON:00020324 function-inhibiting hydrogen/potassium adenosine triphosphatase enzyme (H+/K+ ATPase) binding disposition @en
DRON:00020325 function-inhibiting L-type voltage-gated calcium channel binding disposition @en
DRON:00020326 function-inhibiting vitamin K epoxide reductase binding disposition @en
DRON:00020327 function-inhibiting Na-K-Cl cotransporter 2 (NKCC2) binding disposition @en
DRON:00020328 function-inhibiting T-type calcium channel binding disposition @en
DRON:00698710 function-inhibiting cytochrome P450 2C19 (CYP2C19) binding disposition @en
DRON:00723853 function-inhibiting angiotensin-converting enzyme binding disposition @en
DRON:00723854 function-inhibiting cytochrome P450 2D6 (CYP2D6) binding disposition @en
DRON:00723855 cytochrome P450 isoenzyme 2C19 (CYP2C19) substrate disposition @en
DRON:00723856 cytochrome P450 isoenzyme 2D6 (CYP2D6) substrate disposition @en
DRON:00724207 function-inhibiting angiotensin receptor binding disposition @en