Opening an edit form injects additional redundant blank nodes #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a person record upon first view:
Then I click the edit button and the form shows an extra blank node for identifiers:
Then I click cancel and the extra blank node is in the summary:
This must be happening as a result of one of the service calls when either the form renders or when the instanceselecteditor renders.
I've been stuck on this for too long. The core of it is to try and prevent the creation of duplicate blank nodes that have exactly the same triples under a different blank node value. This duplication happens when data is read in from the
dump-things-serviceinto theshacl-vuegraph store. It will be something like:where both
b705andb707have exactly the same predicates and objects in separate triples. I can't pin the source of the issue down yet.This issue became more noticeable when I solved a previous issue of a record display not updating upon saving a form.
Ok I think I know the source.
shacl-vueis in fact fetching the same record twice, the first time via the "records" endpointrecords/{name}?format=ttl(multiple) when a specific class is selected, and the second time via the "record" endpointrecord?id={curie}&format=ttl(singular) when the user clicks the edit button on a specific record. When the GET request interaction with the service was first introduced intoshacl-vue, I implemented a layman's request caching approach where a "set" is maintained of all previous request URLs, and a second request won't be made to a URL already in a set. This was actually to prevent unnecessary requests, but the prevention of the current issue actually seems like an even more valid reason.I can currently think of different approaches to solve this.
The first is a quick and dirty approach, which is to disable the singular record GET request, because given the current workflow of the application it can safely be assumed that the "multiple records by class" request would already have been made before a singular record request is tried. UPDATE: this works!
However, this should not be the correct or long term solution. For that scenario we can take two approaches: either by developing a smarter caching mechanism, or by updating the
shacl-vuegraph store to prevent "duplicate" blank node creation.