Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Update note mapping and fix uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed Aug 12, 2016
1 parent eeb3ecb commit 3a86d79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions skosprovider_oe/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def get_by_id(self, id):
concept['related'] = result['related_terms']
concept['notes'] = []
note_type_map = {
'scope_note': 'definition',
'indexing_note': 'scopeNote',
'scope_note': 'scopeNote',
'indexing_note': 'note',
'history_note': 'historyNote'
}
for note_type_oe, note_type_skos in note_type_map.items():
Expand Down Expand Up @@ -140,6 +140,7 @@ def _from_dict(self, concept):
if concept['type'] == 'concept':
return Concept(
id = concept['id'],
uri= concept['uri'],
labels = concept['labels'] if 'labels' in concept else [],
broader = concept['broader'] if 'broader' in concept else [],
narrower = concept['narrower'] if 'narrower' in concept else [],
Expand All @@ -154,6 +155,7 @@ def _from_dict(self, concept):
else:
return Collection(
id = concept['id'],
uri = concept['uri'],
labels = concept['labels'] if 'labels' in concept else [],
members = concept['members'] if 'members' in concept else [],
member_of = concept['member_of'] if 'member_of' in concept else [],
Expand Down
1 change: 1 addition & 0 deletions tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,6 @@ def test_source(self):
def test_matches(self):
agr_ls = self.typologie.get_by_id(2103)
self.assertIsInstance(agr_ls.matches, dict)
assert 'https://id.erfgoed.net/thesauri/erfgoedtypes/2103' == agr_ls.uri
assert 'related' in agr_ls.matches
assert 'http://vocab.getty.edu/aat/300008631' in agr_ls.matches['related']

0 comments on commit 3a86d79

Please sign in to comment.