diff --git a/HISTORY.rst b/HISTORY.rst index e663786..481ce33 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,8 @@ :meth:`skosprovider.registry.Registry.get_all` that will be passed to all registered providers. This determines in what language the labels of the returned concepts will displayed. +- Fixed some errors with the :func:`skosprovider.utils.dict_dumper`. It didn't + dump the `matches` or the `subordinate_arrays` of concepts. - Wrote some new documentation on what a provider is and how to use it. Some other documentation work as well such as documenting the `language` parameter in the API better. diff --git a/skosprovider/utils.py b/skosprovider/utils.py index a667d99..55abfac 100644 --- a/skosprovider/utils.py +++ b/skosprovider/utils.py @@ -37,7 +37,9 @@ def dict_dumper(provider): 'narrower': c.narrower, 'broader': c.broader, 'related': c.related, - 'member_of': c.member_of + 'member_of': c.member_of, + 'subordinate_arrays': c.subordinate_arrays, + 'matches': c.matches }) elif isinstance(c, Collection): ret.append({ diff --git a/tests/test_utils.py b/tests/test_utils.py index 483cbf1..030c128 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -39,7 +39,17 @@ def setUp(self): 'narrower': [], 'broader': [], 'related': [], - 'member_of': ['3'] + 'member_of': ['3'], + 'subordinate_arrays': [], + 'matches': { + 'close': [ + 'http://id.python.org/different/types/of/trees/nr/1/the/larch' + ], + 'exact': [], + 'related': [], + 'narrow': [], + 'broad': [] + } } self.chestnut_dump = { 'id': '2', @@ -65,7 +75,17 @@ def setUp(self): 'narrower': [], 'broader': [], 'related': [], - 'member_of': ['3'] + 'member_of': ['3'], + 'subordinate_arrays': [], + 'matches': { + 'close': [], + 'exact': [], + 'related': [ + 'http://id.python.org/different/types/of/trees/nr/17/the/other/chestnut' + ], + 'narrow': [], + 'broad': [] + } } self.species_dump = { 'id': 3, @@ -98,7 +118,15 @@ def setUp(self): 'narrower': [2, 3], 'broader': [], 'related': [], - 'member_of': [] + 'member_of': [], + 'matches': { + 'close': [], + 'exact': [], + 'related': [], + 'narrow': [], + 'broad': [] + }, + 'subordinate_arrays': [] } def tearDown(self):