hydrus: hydrus can't show nested collections

I’m submitting a

  • bug report.
  • feature request.

Current Behaviour:

hydrus can’t show nested collections. (eg. collection of comments on a particular issue/article)

Expected Behaviour:

Quoting @Mec-iS

we possibly want to return a hyperlink to the collection, not the full collection. same we did for nested object in Flock-Demo.

Possible approach

we can have a hyperlink to the endpoint of nested collection something like

{ 
"@type": "Article", 
"@id": "api/articles/id", 
... 
"comments": "api/articles/id/comments", 
... 
} 

Steps to reproduce:

Run hydrus with real-world-app API Doc I submitted at https://github.com/HTTP-APIs/hydrus-real-world-app/pull/2 (The API Doc is not complete but can be used to reproduce this issue by adding an article and trying to get/retrieve comments related to that article)

Do you want to work on this issue?

Yes

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Am I getting it right or missing something?

Exactly. Please prioritise this #386 and #302 for your first weeks Also for @Guttz, we need these implemented before starting anything with the demo or the client.

Couldn’t agree more, that way we can avoid over-engineering, and utilize these Spec based features directly for adding any extra functionality.

Please take some time to map and list everything we are missing from the spec.

If I am not missing something then it will require us to create a new resource named NestedCollection or something, mapped with api/<Collectiontype>/<ID>/<NestedCollectiontype> and having only get responder.

Exactly! You can then parse and use the child ids of item Collectiontype/<ID> to create a partial collection that will have the type of <NestedCollectiontype>

@vddesai1871 What you describe requires the implementation of the IRITemplate spec feature, as we are supposed to provide in the response a IRI that filters the collection with the expected objects. Again, there is no change to be made in the model, see #302 that should have priority for the first weeks of GSOC. In general, everything that is already in the spec and it is not in hydrus should have priority.

This is true, we need to modify the models as well to be able to this. Properties usually point to instances or terminals. Now we need to consider that they will point to collections. We could create a new relationship model GraphIACol or something that links Instance>Abstract Property>Collection. Inherently we would then have to define a separate model for collections maybe, right now it’s just a field in the RDFClass model. Please explore this and work out the details of implementation. We may need to refactor all the models as well to make it less redundant.