gbv / wikidata-jskos

Access Wikidata in JSKOS format
https://coli-conc.gbv.de/services/wikidata/
MIT License
6 stars 3 forks source link

Fix writing of RVK mappings #44

Closed nichtich closed 4 years ago

nichtich commented 4 years ago

Writing RVK mappings is not possible if the RVK notations contains spaces. Maybe this depends on Wikidata settings, see https://www.wikidata.org/wiki/Property_talk:P1150#Why_.22string.22.3F and https://www.wikidata.org/wiki/Wikidata_talk:Identifier_migration.

stefandesu commented 4 years ago

I think this fails because the uriPattern for RVK does not represent a URI with properly encoded notation. Current uriPattern is:

^http://rvk\\.uni-regensburg\\.de/nt/((LD,)?[A-Z]([A-Z](%20[0-9]+([a-z]|\\.[0-9]+)?( [A-Z][0-9]*)?)?)?( - [A-Z]([A-Z]( [0-9]+([a-z]|\\.[0-9]+)?( [A-Z][0-9]*)?)?)?)?)$
stefandesu commented 4 years ago

It's this piece of code that isn't working correctly. JavaScript's String.replace only replaces the first occurrences in the string. I will try to adjust it and see if it works then.

stefandesu commented 4 years ago

Works. 👍