Ignore wikidata claims without datavalue
This commit is contained in:
parent
b5d2b99ced
commit
8d52ef1106
3 changed files with 1860 additions and 8 deletions
|
@ -47,8 +47,10 @@ export default class Wikidata {
|
|||
const claimsList: any[] = entity.claims[claimId]
|
||||
const values = new Set<string>()
|
||||
for (const claim of claimsList) {
|
||||
const value = claim.mainsnak.datavalue.value;
|
||||
values.add(value)
|
||||
const value = claim.mainsnak?.datavalueq?.value;
|
||||
if(value !== undefined){
|
||||
values.add(value)
|
||||
}
|
||||
}
|
||||
claims.set(claimId, values);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,10 @@ export default class ImageProviderSpec extends T {
|
|||
expects("https://commons.wikimedia.org/wiki/Special:FilePath/File%3ABrugge_Leeuwstraat_zonder_nummer_Leeuwbrug_-_119334_-_onroerenderfgoed.jpg?width=500&height=400",{
|
||||
image:"File:Brugge_Leeuwstraat_zonder_nummer_Leeuwbrug_-_119334_-_onroerenderfgoed.jpg"
|
||||
}, "WikimediaImageProvider")
|
||||
|
||||
expects("https://commons.wikimedia.org/wiki/Special:FilePath/File%3APapageno_Jef_Claerhout.jpg?width=500&height=400",{
|
||||
"wikimedia_commons": "File:Papageno_Jef_Claerhout.jpg"
|
||||
}, "WikimediaImageProvider")
|
||||
|
||||
|
||||
}]
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue