29
29
DRUGBANK_BIO2RDF = "http://bio2rdf.org/drugbank:"
30
30
NDFRT_BASE = "http://purl.bioontology.org/ontology/NDFRT/"
31
31
DRON_BASE = "http://purl.obolibrary.org/obo/"
32
- # OHDSI_BASE = "http://purl.org/net/ohdsi#"
32
+ OHDSI_BASE = "http://purl.org/net/ohdsi#"
33
33
34
34
35
35
class DictItem :
36
36
37
- def __init__ (self , pt , db_uri1 , db_uri2 , rxcui , chebi , nui , dron , nameAndRole ):
37
+ def __init__ (self , pt , db_uri1 , db_uri2 , rxcui , chebi , nui , dron , omopid , nameAndRole ):
38
38
self .pt = str (pt )
39
39
self .db_uri1 = str (db_uri1 )
40
40
self .db_uri2 = str (db_uri2 )
41
41
self .rxcui = str (rxcui )
42
42
self .chebi = str (chebi )
43
43
self .dron = str (dron )
44
+ self .omopid = str (omopid )
44
45
45
46
if nui and nameAndRole :
46
47
self .drugClass = Set ([str (nui )+ '|' + str (nameAndRole )])
@@ -56,7 +57,7 @@ def __init__(self, pt, db_uri1, db_uri2, rxcui, chebi, nui, dron, nameAndRole):
56
57
for item in data_set :
57
58
58
59
if item ["unii" ] not in dict_moieties :
59
- moiety = DictItem (item ["pt" ], item ["db_uri1" ], item ["db_uri2" ], item ["rxcui" ], item ["chebi" ], item ["nui" ], item ["dron" ] ,item ["nameAndRole" ])
60
+ moiety = DictItem (item ["pt" ], item ["db_uri1" ], item ["db_uri2" ], item ["rxcui" ], item ["chebi" ], item ["nui" ], item ["dron" ], item [ "omopid" ] ,item ["nameAndRole" ])
60
61
dict_moieties [item ["unii" ]]= moiety
61
62
62
63
else :
@@ -72,7 +73,8 @@ def __init__(self, pt, db_uri1, db_uri2, rxcui, chebi, nui, dron, nameAndRole):
72
73
dict_moieties [item ["unii" ]].dron = item ["dron" ]
73
74
if not dict_moieties [item ["unii" ]].chebi :
74
75
dict_moieties [item ["unii" ]].chebi = item ["chebi" ]
75
- #print item['nui']+'|'+item['nameAndRole']
76
+ if not dict_moieties [item ["unii" ]].omopid :
77
+ dict_moieties [item ["unii" ]].omopid = item ["omopid" ]
76
78
77
79
if item ['nui' ] and item ['nameAndRole' ]:
78
80
if dict_moieties [item ["unii" ]].drugClass :
@@ -159,8 +161,8 @@ def __init__(self, pt, db_uri1, db_uri2, rxcui, chebi, nui, dron, nameAndRole):
159
161
if v .dron :
160
162
graph .add ((URIRef (ACTIVEMOIETY_BASE + str (k )), linkedspls_vocabulary ["DrOnId" ], URIRef (DRON_BASE + v .dron )))
161
163
162
- # if v.omopid:
163
- # graph.add((URIRef(ACTIVEMOIETY_BASE + str(k)), linkedspls_vocabulary["OMOPConceptId"], Literal(OHDSI_BASE + str(int(float( v.omopid) )))))
164
+ if v .omopid :
165
+ graph .add ((URIRef (ACTIVEMOIETY_BASE + str (k )), linkedspls_vocabulary ["OMOPConceptId" ], Literal (OHDSI_BASE + str (( v .omopid )))))
164
166
165
167
166
168
0 commit comments