From c531eb18f04990f3118b93ae5222b3f3e2e8a6c6 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 16 Jan 2014 17:22:09 -0800 Subject: [PATCH] make sure @vocab url has a trailing #. Its needed to construct better triple predicate names. --- htsworkflow/submission/encoded.py | 2 +- htsworkflow/submission/test/test_encoded.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htsworkflow/submission/encoded.py b/htsworkflow/submission/encoded.py index f113beb..05813fd 100644 --- a/htsworkflow/submission/encoded.py +++ b/htsworkflow/submission/encoded.py @@ -217,7 +217,7 @@ class ENCODED: def get_schema_url(self, obj): obj_type = self.get_object_type(obj) if obj_type: - return self.prepare_url(ENCODED_SCHEMA_ROOT + obj_type + '.json') + return self.prepare_url(ENCODED_SCHEMA_ROOT + obj_type + '.json') + '#' def _is_encoded_object(self, obj): '''Test to see if an object is a JSON-LD object diff --git a/htsworkflow/submission/test/test_encoded.py b/htsworkflow/submission/test/test_encoded.py index 21eed84..5483f6f 100644 --- a/htsworkflow/submission/test/test_encoded.py +++ b/htsworkflow/submission/test/test_encoded.py @@ -66,6 +66,7 @@ class TestEncoded(TestCase): encode = ENCODED('test.encodedcc.org') url = encode.prepare_url(library['@id']) context = encode.create_jsonld_context(library, url) + self.assertEqual(context['@vocab'], 'http://test.encodedcc.org/profiles/library.json#') self.assertEqual(context['award'], linked_id ) self._verify_context(context, 'library') # namespaces not added yet. -- 2.30.2