Skip to content

Commit 9f8769d

Browse files
committed
adding support for umls:sver
1 parent 2961031 commit 9f8769d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

umls2rdf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
rdfs:comment "$comment" ;
3333
rdfs:label "$label" ;
3434
owl:imports <http://www.w3.org/2004/02/skos/core> ;
35-
owl:versionInfo "$versioninfo" .
35+
owl:versionInfo "$versioninfo" ;
36+
umls:sver "$sver" .
3637
3738
""")
3839

@@ -80,6 +81,7 @@
8081
MRSTY_CUI = 0
8182
MRSTY_TUI = 1
8283

84+
MRSAB_SVER = 6
8385
MRSAB_LAT = 19
8486

8587
UMLS_LANGCODE_MAP = {"eng" : "en", "fre" : "fr", "cze" : "cz", "fin" : "fi", "ger" : "de", "ita" : "it", "jpn" : "jp", "pol" : "pl", "por" : "pt", "rus" : "ru", "spa" : "es", "swe" : "sw", "scr" : "hr", "dut" : "nl", "lav" : "lv", "hun" : "hu", "kor" : "kr", "dan" : "da", "nor" : "no", "heb" : "he", "baq" : "eu"}
@@ -474,6 +476,7 @@ def __init__(self,ont_code,ns,con,load_on_cuis=False):
474476
self.cui_roots = set()
475477
self.lang = None
476478
self.ont_properties = dict()
479+
self.sver = None
477480

478481
def load_tables(self,limit=None):
479482
mrconso = UmlsTable("MRCONSO",self.con)
@@ -484,6 +487,8 @@ def load_tables(self,limit=None):
484487
mrsab = UmlsTable("MRSAB", self.con)
485488
for sab_rec in mrsab.scan(filt="RSAB = '" + self.ont_code + "'", limit=1):
486489
self.lang = sab_rec[MRSAB_LAT].lower()
490+
self.sver = sab_rec[MRSAB_SVER]
491+
487492
mrconso_filt = "SAB = '%s' AND lat = '%s' AND SUPPRESS = 'N'"%(
488493
self.ont_code,self.lang)
489494
for atom in mrconso.scan(filt=mrconso_filt,limit=limit):
@@ -645,6 +650,7 @@ def write_into(self,file_path,hierarchy=True):
645650
label = self.ont_code,
646651
comment = comment % self.ont_code,
647652
versioninfo = conf.UMLS_VERSION,
653+
sver = self.sver,
648654
uri = self.ns
649655
)
650656
fout.write(ONTOLOGY_HEADER.substitute(header_values))

0 commit comments

Comments
 (0)