Closed kunwarj closed 9 months ago
Code still good, @ahayes does this fix the issues you reported?
Code still good, @ahayes does this fix the issues you reported?
Yes. The single test triple shows up and the excludes appear to work correctly as well.
@kunwarj do you have a list or matrix of the various tests you ran? I'm wondering how many of the numerous combinations were tested, particularly cases with elements other than strings.
Per @kunwarj
Nunaliit uses create.json doc while creating a new document whereas while editing, it uses the document from database. With my previous commit, I had a triple object in the create.json regardless of the default value for subject/predicate/object. But while editing, neither there was default triple object in the existing doc, nor there was a mechanism to add triple attribute to the exiting doc. That is why it was not working while editing.
How it works with current change:
set triple object for single/array in create.json only if there is default value for subject/predicate/object
while rendering the HTML, the javascript first gets the default value for particular triple object id from the create.json.
If there is no default triple in create.json, check if a triple should be appended to the submission doc(this helps appending triple to the submission doc only when user interacts with the triple field). If user interact with the triple field and there is no default triple in create.json, create a new triple object schema to be appended to the submission doc
Checks if there is no triple object with particular key in the submission doc (exiting records/ and new document without default triple, does not have triple object in the submission doc) and a triple object is created in step 2.1., append the triple to the submission doc
I still have some concerns that perhaps all the configuration combinations have not been tested, but if this isn't breaking anything then we should probably get it in and into the documentation so we can start to try it in our various atlases. As @alexgao1 also pointed out in the issue, there will also have to be some work to add support to the schema builder. At the very least, the schema builder shouldn't break if a schema with triples or arrays of triples gets loaded in.
I still have some concerns that perhaps all the configuration combinations have not been tested, but if this isn't breaking anything then we should probably get it in and into the documentation so we can start to try it in our various atlases. As @alexgao1 also pointed out in the issue, there will also have to be some work to add support to the schema builder. At the very least, the schema builder shouldn't break if a schema with triples or arrays of triples gets loaded in.
Jagdish has reported testing with various combinations - all same type, two of same type, all different types.
Single triple creation works; single triple editing on an existing record does not work.