From 6249e48e8212ef90bd45e29b39dcca3fa1847763 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Fri, 9 Jan 2015 16:40:40 -0800 Subject: [PATCH] get_schema_url only works on object types now, so change some code to meet the new api --- htsworkflow/submission/encoded.py | 3 ++- htsworkflow/submission/test/test_encoded.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htsworkflow/submission/encoded.py b/htsworkflow/submission/encoded.py index 66cb62d..2dbdc4b 100644 --- a/htsworkflow/submission/encoded.py +++ b/htsworkflow/submission/encoded.py @@ -165,8 +165,9 @@ class ENCODED: self.contexts[None] = default context attributes added to any type self.contexts[type] = context attributes for this type. ''' + obj_type = self.get_object_type(obj) context = {'@base': urljoin(default_base, obj['@id']), - '@vocab': self.get_schema_url(obj)} + '@vocab': self.get_schema_url(obj_type)} # add in defaults context.update(self.contexts[None]) for t in obj['@type']: diff --git a/htsworkflow/submission/test/test_encoded.py b/htsworkflow/submission/test/test_encoded.py index a1b22a0..17b793b 100644 --- a/htsworkflow/submission/test/test_encoded.py +++ b/htsworkflow/submission/test/test_encoded.py @@ -110,7 +110,8 @@ class TestEncoded(TestCase): bio_base = encode.prepare_url(obj['biosample']['@id']) url = encode.prepare_url('/libraries/ENCLB044ZZZ/?format=json&embed=False') - schema_url = encode.get_schema_url(obj) + obj_type = encode.get_object_type(obj) + schema_url = encode.get_schema_url(obj_type) encode.add_jsonld_context(obj, url) self.assertEqual(obj['biosample']['@context']['@base'], bio_base) -- 2.30.2