gbv / jskos-server

Web service to access JSKOS data
https://coli-conc.gbv.de/api/
MIT License
6 stars 4 forks source link

extent of concordances is not automatically updated after import of mappings #217

Closed nichtich closed 9 months ago

nichtich commented 9 months ago

I imported a concordance via npm run import concordance and then mappings belonging to this concordance with npm run import mappings but the extent value is not set to give the number of mappings. Searching for the mappings by concordance does work.

stefandesu commented 9 months ago

I was not able to reproduce this locally. Do you still have the exact commands you used to import the concordance and the mappings?

(I do remember having run into this issue before, but I didn't create an issue, so I'm not sure what my conclusion was...)

stefandesu commented 9 months ago

I did find notes about the issue I had and it was, I think, a different one: A concordances uri and internal _id do not necessarily match, but currently the import script assumes they do. It was easy to reproduce: Create a new concordance via Cocoda (not via import) and try to import mappings into it.

However, as far as I can tell, you used the import script both for the concordance and its mappings. In that case, the issue should not occur. The concordance I assume you imported have matching uri and _id.

stefandesu commented 9 months ago

Update: The issue occurs when the concordance is only specified via the existing partOf field in the imported JSKOS data. I'll implement it so that it will also update the extent of affected concordances in that case. Extent of mappings is also not updated when deleting mappings via CLI, so I will fix that as well.