<commit_before>Currently I'm handling SetProperty and checking for 'title'. When 'title' is being changed, I rename the object on disk and sometimes this leads to adjusting some properties (e.g. removing or altering filename override).

Unfortunately, the property editor reads all the properties, including the filename override, and then writes all of them back. The filename override happens to come after 'title' and so overwrites my changes.

One solution would be to re-architect the property page, but maybe the cheaper approach is to filter properties on reading/writing: skip hidden properties when reading and ignore them when writing. They're internal after all.

But then we'd have to have a separate setProperty for our own internal uses.<commit_msg>TODO changes.<commit_after>Currently I'm handling SetProperty and checking for 'title'. When 'title' is being changed, I rename the object on disk and sometimes this leads to adjusting some properties (e.g. removing or altering filename override).

Unfortunately, the property editor reads all the properties, including the filename override, and then writes all of them back. The filename override happens to come after 'title' and so overwrites my changes.

One solution would be to re-architect the property page, but maybe the cheaper approach is to filter properties on reading/writing: skip hidden properties when reading and ignore them when writing. They're internal after all.

But then we'd have to have a separate setProperty for our own internal uses.


It seems that the saving code just writes out all property fields of a loaded item. Those are populated by datasource.getItem(), which just copies all the available properties from RDF.

It would therefore be nice to have datasource.saveItem() instead of having the code directly in properties.js. It's still not enough for us, but at least it'd have all the saving in one place.

Why it's not enough? Because someone might still do it manually.

So we'd need to:
1. Have a list of internal properties.
2. Skip these in getItem.
3. Ignore these in setProperty, unless it's setInternalProperty.
4. Skip these in saveItem too, just in case.
{'fraction_non_alphanumeric': 0.04337794185509922, 'fraction_numerical': 0.0018458698661744347, 'mean_word_length': 4.660574412532637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '281160', 'n_tokens_mistral': 509, 'n_tokens_neox': 484, 'n_words': 333}