Skip to content

Commit

Permalink
Fix for #26.
Browse files Browse the repository at this point in the history
When a language tag is invalid, do not drop the label but set the language to
undetermined.
  • Loading branch information
Koen Van Daele committed Sep 6, 2016
1 parent ae4fe8a commit c3ca799
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.3.1 (2016-09-??)
------------------

- Handle a bug with private language tags. Currently not recognised by the
language_tags library. The Getty services do use them. When encountered, we
fall back to the undeterminded language. (#26)

0.3.0 (2016-08-11)
------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# The short X.Y version.
version = '0.3'
# The full version, including alpha/beta/rc tags.
release = '0.3.0'
release = '0.3.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

setup(
name='skosprovider_getty',
version='0.3.0',
version='0.3.1',
description='Skosprovider implementation of the Getty Vocabularies',
long_description=README + '\n\n' + CHANGES,
packages=packages,
Expand Down
7 changes: 6 additions & 1 deletion skosprovider_getty/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ def _create_label(literal, type):
language = literal.language
if language is None:
language = 'und'
return Label(literal.toPython(), type, language)
try:
l = Label(literal.toPython(), type, language)
except ValueError as e:
log.warn(e)
l = label(literal.toPython(), type, 'und')
return l


def _create_note(graph, uri, type, change_notes=False):
Expand Down

0 comments on commit c3ca799

Please sign in to comment.