From 1e925c6fb6aac1d24ece642b015a258fce11f355 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 20 Oct 2015 16:18:37 -0700 Subject: [PATCH] updates to deal with encoded 33 path changes --- htsworkflow/submission/encoded.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htsworkflow/submission/encoded.py b/htsworkflow/submission/encoded.py index c8ed195..a8d554f 100644 --- a/htsworkflow/submission/encoded.py +++ b/htsworkflow/submission/encoded.py @@ -41,10 +41,10 @@ ENCODED_CONTEXT = { # e.g. in the tree there was a sub-dictionary named 'biosample' # That dictionary had a term 'biosample_term_id, which is the # term that should be used as the @id. - 'biosample': { + 'Biosample': { 'biosample_term_id': {'@type': '@id'}, }, - 'experiment': { + 'Experiment': { "assay_term_id": {"@type": "@id"}, "files": {"@type": "@id"}, "original_files": {"@type": "@id"}, @@ -59,7 +59,7 @@ ENCODED_CONTEXT = { # "state": "vcard:region", # "country": "vcard:country" #}, - 'library': { + 'Library': { 'nucleic_acid_term_id': {'@type': '@id'} } } @@ -152,6 +152,11 @@ class ENCODED: if self._is_encoded_object(obj): context = self.create_jsonld_context(obj, default_base) if len(context) > 0: + # this is a total hack for relese 33 of + # encoded. They changed their model and + # i'm not sure what to do about it. + if obj.get('@context') == '/terms/': + del obj['@context'] obj.setdefault('@context', {}).update(context) def add_jsonld_namespaces(self, context): -- 2.30.2