GSOC- Week 8

Priyanshu Nayan
3 min readJul 28, 2020

My exams are over now. I picked up from where I left off, the expansion of JSON-LD before making any operations on it. I was able to finish this PR this week. Honestly speaking, this is my most favourite PR yet. A lot of effort i have put into it. I have been wanting to do it since the starting of the phase I. I hope our doc_maker module will be able to parse more number of JSON-LD API docs, and that too with more robustness, will throw error where it should, and will try to compensate, where it could too. For eg, any API must contain JSON-LD reserved keys like @id, @context and @type. Missing these must throw error, while missing out title , description is not such a big deal, as they are more for humans than machines, so the module will compensate for these errors. Some authors prefer to use expanded URIs, thanks to expansion, now this module will be able to parse those too. Some authors might mix compacted URI and expanded URI, so we cover them too. It's nice and a great improvement to our core library. All the work has been covered in this PR:

The next thing that I did was removed dependency of classes on collection. Earlier a collection could contain instances of particular class only. But the spec defines a collection as somehow related resource. So, logically a collection can contain instances of different classes. To achieve this, i added another method add_supported_collection that takes in the collection and adds to the HydraDoc object. Also, I removed collection from the add_supported_class. There are now two different functions to fulfil two different purposes. I hope this approach will make more sense to the API authors. Hence, this was also a major improvement in the core library. All of the work related to this are in this PR:

Then I started working on the searching of events in the hydra-agent. One would like to filter members from the collection on the basis of some criteria. Presently, agent does not support this feature. To construct a query one may want to take help of the template returned by the server, in our case, hydrus. But I noticed, the template returned was of incorrect format, so I created one minor PR to fix that:

This phase has been really conceptually challenging. We addressed some important concepts. Most of the tasks that I did required going through long conversation in the specification repository and trying to figure out why they chose one over another and if we can do it in any other way. I think we are very much closer to the stage where the changes in the specification can easily be integrated in our core library without much breaking changes. Although there are couple of things that I still would want to do, if time permits. One of them would be the refactoring of the core library, currently it requires a bit of effort to understand the library and all the classes and helper functions are one file and second might seem a little debatable but yet I want to see core using absolute URIs wherever it can. This would remove a lot of ambiguity and remove tight coupling of code that we have between hydrus & core, and agent & core right now.

The evaluations have begun for this phase. Let’s hope for the best. Thank you.

--

--