Commit d7b9a6f0 authored by tobinski's avatar tobinski
Browse files

Better detect names

parent 62e00a59
...@@ -195,8 +195,16 @@ class WikidataNormalizerTransformer extends Transform { ...@@ -195,8 +195,16 @@ class WikidataNormalizerTransformer extends Transform {
if (name2 !== null) { if (name2 !== null) {
return name2; 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) { } catch (error) {
return null; return null;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment