From b552c8771579e7d3ebba6acb8b38cc9ccb826e95 Mon Sep 17 00:00:00 2001 From: cmungall Date: Thu, 19 Apr 2018 14:40:03 -0700 Subject: [PATCH] When deriving json-ld context from db-xrefs yaml, use new rdf_uri_prefix field. https://github.com/geneontology/go-site/issues/617 --- bin/go-xrefs-to-context.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/go-xrefs-to-context.py b/bin/go-xrefs-to-context.py index 48efbad..1170cbb 100755 --- a/bin/go-xrefs-to-context.py +++ b/bin/go-xrefs-to-context.py @@ -18,7 +18,12 @@ def main(fn): if db in pm and pm[db] != url: logging.warn("Replacing {} : {} -> {}".format(db, pm[db], url)) pm[db] = url - + + # overwrite if rdf_uri_prefix is known. See https://github.com/geneontology/go-site/issues/617 + for p in prefixes: + if 'rdf_uri_prefix' in p: + pm[p['database']] = p['rdf_uri_prefix'] + obj = {'@context': pm} print(json.dumps(obj, indent=4))