Notes on recursive blank node resolution for POSTing a record to service #45

Open
opened 2025-02-14 13:34:48 +00:00 by jsheunis · 0 comments
jsheunis commented 2025-02-14 13:34:48 +00:00 (Migrated from hub.datalad.org)

This is just to keep track of my thoughts:

        // Some exploration:
        // - we need to send a POST request for every NAMED NODE record in formData,
        //   with blank nodes resolved because this is what the service needs.
        // - we can get the named nodes by using getRecordSubjectTerm (or a refactored version of this)
        // - for all triples of a named node, some objects will be blank nodes
        // - these blank nodes might be in formData themselves if they were edited,
        //   or in graphData if they werent edited but rather only linked to the named node that was edited
        // - this means blank node resolution needs to consider blank nodes in both formdata and graphdata
        // - or does it? upon submission, all forms that were edited would already have been saved, 
        //   which means that all relevant blank nodes that were linked to the form would also have been saved to graphData.
        //   This suggests that all blank node resolution could happen via graphData
        // So let's think about a design:
        // - For all classes in formData:
        //   - if the associated nodeshape does NOT have a propertyshape with sh:path being the same as ID_IRI,
        //     this means the class's records will be blank nodes and we can skip the whole class
        //   - if the associated nodeshape DOES HAVE a propertyshape with sh:path being the same as ID_IRI,
        //     we need to create a POST for each record of this class
        // - For all named node records of a class:
        //   - we need to turn it into a set of triples
        //   - formNodeToQuads can be used for this because it returns an array of "first-level" quads, i.e. not resolved
        //   - we can then loop through the quads and test for the object's termtype being blanknode
        //   - if an object's termtype == blanknode:
        //     - we need to find the triples with that blanknode as subject in graphData, recursively
This is just to keep track of my thoughts: ```javascript // Some exploration: // - we need to send a POST request for every NAMED NODE record in formData, // with blank nodes resolved because this is what the service needs. // - we can get the named nodes by using getRecordSubjectTerm (or a refactored version of this) // - for all triples of a named node, some objects will be blank nodes // - these blank nodes might be in formData themselves if they were edited, // or in graphData if they werent edited but rather only linked to the named node that was edited // - this means blank node resolution needs to consider blank nodes in both formdata and graphdata // - or does it? upon submission, all forms that were edited would already have been saved, // which means that all relevant blank nodes that were linked to the form would also have been saved to graphData. // This suggests that all blank node resolution could happen via graphData // So let's think about a design: // - For all classes in formData: // - if the associated nodeshape does NOT have a propertyshape with sh:path being the same as ID_IRI, // this means the class's records will be blank nodes and we can skip the whole class // - if the associated nodeshape DOES HAVE a propertyshape with sh:path being the same as ID_IRI, // we need to create a POST for each record of this class // - For all named node records of a class: // - we need to turn it into a set of triples // - formNodeToQuads can be used for this because it returns an array of "first-level" quads, i.e. not resolved // - we can then loop through the quads and test for the object's termtype being blanknode // - if an object's termtype == blanknode: // - we need to find the triples with that blanknode as subject in graphData, recursively ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
trr379/annotate-trr379-demo#45
No description provided.