gbv / jskos-tools

Tools for working with the JSKOS data format.
https://gbv.github.io/jskos-tools/
MIT License
2 stars 0 forks source link

Improve mappingCSV #24

Open stefandesu opened 4 years ago

stefandesu commented 4 years ago

The method was improve in the past (#6), but there are still many more things that can improved:

@nichtich Any further ideas?

nichtich commented 4 years ago

I'd not aim at functionality but simplicity and round-tripping with JSKOS convert from jskos-cli.

stefandesu commented 4 years ago

Hmm, I didn't know that jskos-cli has a completely separate set of conversion methods. We should definitely bring them together (I guess that's what you mean by "round-tripping with JSKOS convert from jskos-cli"?)

The thing is that almost all these features I listed above are, in my opinion, necessary for the conversion methods to make sense. Especially the first three points are things I stumbled upon when fixing the CSV conversion in jskos-server. For example, because jskos-server is streaming mappings that are converted to CSV, we don't have information about the maximum number of target concepts. Because the current method to generate the headers requires access to ALL mappings though, we can't used it and have to manually specific the header row. Also, jskos-server would currently fail to output mapping creator names if creator.en is empty (that might be currently hardcoded into Cocoda, but it actually shouldn't be expected) because the conversion method doesn't deal with that.

Actually, it would probably be best to completely rewrite it all, making it more flexible (i.e. can be used not only for mappings, but also for other JSKOS entities), and replacing both jskos-tools' and jskos-cli's conversion methods with the new ones.