From: Diane Trout Date: Fri, 17 Jan 2014 01:22:09 +0000 (-0800) Subject: make sure @vocab url has a trailing #. Its needed to construct better triple predicat... X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=c531eb18f04990f3118b93ae5222b3f3e2e8a6c6 make sure @vocab url has a trailing #. Its needed to construct better triple predicate names. --- 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.