[Archivesspace_Users_Group] Retrieving tree info via API (what are "waypoints"?)

Majewski, Steven Dennis (sdm7g) sdm7g at virginia.edu
Tue Jul 23 10:52:41 EDT 2019

I believe the rationale of the waypoints was that initially, it was expected that resource children/ archival objects would fall into a more balanced tree structure, but it turned out that there were many flat hierarchies with hundreds of top level children, and getting all of the children at once was not working very efficiently. So with they waypoint calls, you may only be getting some of the children, but the display can start populating the tree display while making additional calls for the rest. 

I may have some postman examples and internal notes around somewhere: I’ll see what I can dig out. 

— Steve. 

> On Jul 23, 2019, at 9:05 AM, Trevor Thornton <trthorn2 at ncsu.edu> wrote:
> Hi everybody-
> I'm building a service using these API endpoints (or I think I am):
> [:GET] /repositories/:repo_id/resources/:id/tree/root <http://archivesspace.github.io/archivesspace/api/#fetch-tree-information-for-the-top-level-resource-record>
> [:GET] /repositories/:repo_id/resources/:id/tree/node <http://archivesspace.github.io/archivesspace/api/#fetch-tree-information-for-an-archival-object-record-within-a-tree>
> These incorporate the concept of "waypoints", which I admit that I'm not familiar with in this context, and it isn't explained very well in the documentation. This is what I have to work with (these are elements included in the API response):
> child_count – the number of immediate children
> waypoints – the number of “waypoints” those children are grouped into
> waypoint_size – the number of children in each waypoint
> precomputed_waypoints – a collection of arrays (keyed on child URI) in the same format as returned by the ’/waypoint’ endpoint. Since a fetch for a given node is almost always followed by a fetch of the first waypoint, using the information in this structure can save a backend call.
> Can anyone explain what exactly waypoints are and how they are different from children? In the examples I've seen, the "precomputed_waypoints" element in the response looks like a convoluted way (an array value of the lone element in an object, which is itself the value of the lone element in another object) to provide the children nodes of the given node (or root). What's the difference?
> Thanks,
> Trevor
> -- 
> Trevor Thornton
> Applications Developer, Digital Library Initiatives
> North Carolina State University Libraries
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190723/8d4a4bdd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3598 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20190723/8d4a4bdd/attachment.bin>

More information about the Archivesspace_Users_Group mailing list