From 28cb38752acd6d12cffe423fc15633a9bfdb8337 Mon Sep 17 00:00:00 2001 From: Ray Plante Date: Thu, 18 Jul 2019 10:00:17 -0400 Subject: [PATCH] fix doi ref resolver: include correct _extensionSchemas property --- python/nistoar/nerdm/convert.py | 2 +- python/nistoar/nerdm/tests/test_convert_doi.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/python/nistoar/nerdm/convert.py b/python/nistoar/nerdm/convert.py index 1747d59..4a3f1e9 100644 --- a/python/nistoar/nerdm/convert.py +++ b/python/nistoar/nerdm/convert.py @@ -362,7 +362,7 @@ def _doiinfo2reference(info, resolver): if info.citation_text: out['citation'] = info.citation_text - out['_extensionSchemas'] = [ CORE_SCHEMA_URI + "#DCiteReference" ] + out['_extensionSchemas'] = [ CORE_SCHEMA_URI+"#/definitions/DCiteReference" ] return out diff --git a/python/nistoar/nerdm/tests/test_convert_doi.py b/python/nistoar/nerdm/tests/test_convert_doi.py index f41e51c..436fbce 100644 --- a/python/nistoar/nerdm/tests/test_convert_doi.py +++ b/python/nistoar/nerdm/tests/test_convert_doi.py @@ -241,6 +241,9 @@ def test_datacite_doiinfo2reference(self): self.assertEqual(ref['location'], "https://goober.org/10.10/XXX") self.assertEqual(ref['issued'], '2002') self.assertEqual(ref['citation'], 'ibid') + self.assertIn('_extensionSchemas', ref) + self.assertTrue(isinstance(ref['_extensionSchemas'], list)) + self.assertTrue(ref['_extensionSchemas'][0].startswith("https://data.nist.gov/od/dm/nerdm-schema/v0.2#/definitions/"), msg="Unexpected extension schema URI: "+ref['_extensionSchemas'][0]) class TestDOIResolver(unittest.TestCase):