sillsdev / languageforge-lexbox

Language Forge / Language Depot unification project
MIT License
6 stars 2 forks source link

define semantic domain type in CRDTs #852

Open hahn-kev opened 1 month ago

hahn-kev commented 1 month ago

Semantic domains will consist of (at least) 2 fields.

in FLEx there are more fields, for questions and such, not worried about those for now.

I would recommend starting by just creating the new type, and the changes to create and edit the domains. Then creating some automated tests for those functions, possibly including determining the hierarchy based on the index.

Once it's fully defined, then I would modify the field on Sense to be a reference (or references). A custom change should be defined for modifying this reference as the json patch method will not work as it would allow invalid references. We might just let the UI author it as a json patch, and in the server side pull that patch out into it's own change, but I'm not sure what will work best there.

Side note, somewhere in the code base we will want to define all the domains so they are pre populated in the database. This should be done as a single commit with a hardcoded GUID, this will ensure that we can't end up with duplicate domains by accidentally pre populating the domain list twice.

rmunn commented 1 month ago

There's an XML file in liblcm that defines the canonical list of semantic domains, with canonical hardcoded GUIDs. We should use that list, whether via a Git submodule or by simply copying the file (it hardly ever changes, so if there's a change we can just copy the change).