Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
histhub
wikidata-lib
Commits
2bf9d43d
Commit
2bf9d43d
authored
Oct 10, 2019
by
Tobinsk
Browse files
Merge branch '3-missing-names' into 'master'
Resolve "Missing names" Closes
#3
See merge request
!7
parents
35eff0fb
c6f9fde7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wikidata-normalizer-transformer.ts
View file @
2bf9d43d
...
...
@@ -195,8 +195,16 @@ class WikidataNormalizerTransformer extends Transform {
if
(
name2
!==
null
)
{
return
name2
;
}
const
name3
=
this
.
getAlternativNames
(
obj
)[
0
];
if
(
name3
!==
null
)
{
return
name3
;
}
// this often fails. Then we use null from the catch
const
lang
=
Object
.
keys
(
obj
.
labels
)[
0
];
return
obj
.
labels
[
lang
].
value
;
return
this
.
getAlternativNames
(
obj
)[
0
];
}
catch
(
error
)
{
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment