Skip to content

Commit b358fc3

Browse files
committed
add sver to umls_semantictypes.ttl output
1 parent 9f8769d commit b358fc3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

umls2rdf.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@prefix owl: <http://www.w3.org/2002/07/owl#> .
2323
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
2424
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
25-
@prefix umls: <http://purl.bioontology.org/ontology/> .
25+
@prefix umls: <https://identifiers.org/umls/> .
2626
2727
"""
2828

@@ -31,13 +31,12 @@
3131
a owl:Ontology ;
3232
rdfs:comment "$comment" ;
3333
rdfs:label "$label" ;
34-
owl:imports <http://www.w3.org/2004/02/skos/core> ;
3534
owl:versionInfo "$versioninfo" ;
3635
umls:sver "$sver" .
3736
3837
""")
3938

40-
STY_URL = "http://purl.bioontology.org/ontology/STY/"
39+
STY_URL = "https://identifiers.org/umls/STY/"
4140
HAS_STY = "umls:hasSTY"
4241
HAS_AUI = "umls:aui"
4342
HAS_CUI = "umls:cui"
@@ -712,10 +711,15 @@ def write_semantic_types(self,sem_types,fout):
712711
if not os.path.isdir(conf.OUTPUT_FOLDER):
713712
raise Exception("Output folder '%s' not found."%conf.OUTPUT_FOLDER)
714713

714+
semtypes_ontology_stmt_ttl = """<%s>
715+
a owl:Ontology ;
716+
umls:sver "%s" .""" % (STY_URL, conf.UMLS_VERSION)
717+
715718
sem_types = generate_semantic_types(con,with_roots=True)
716719
output_file = os.path.join(conf.OUTPUT_FOLDER,"umls_semantictypes.ttl")
717720
with codecs.open(output_file,"w","utf-8") as semfile:
718721
semfile.write(PREFIXES)
722+
semfile.write(semtypes_ontology_stmt_ttl)
719723
semfile.write(sem_types)
720724
semfile.flush()
721725
semfile.close()

0 commit comments

Comments
 (0)