User:Jay (CIS-A2K)/Report 2

Name: Jay Prakash

Position: Intern (tech), Access to Knowledge

Report period: 1 Dec 2020 – 31 Dec 2020

1 Dec 2020 - 15 Dec 2020

edit

In the fourth (previous) week of my Internship, I had two video calls with Bodhisattwa Mandal, Wikidata Co-ordinator, to discuss the next project which was Wikidata Lexeme tool बोध (bodh). This tool will allow users to login using Wikimedia OAuth and let them add and edit the sense/forms/statements from their interface in an efficient way.

So in the this fifth week of my Internship, I started feasibility and Wikidata APIs study. Since Wikidata API is very different from MediaWiki APIs. Following Wikidata APIs modules were finalized to use.

  • wbladdform
  • wbladdsense
  • wbremoveclaims
  • wbgetentities
  • wbleditsenseelements
  • wbleditformelements

Now after feasibility study, I have decided three main frameworks to develop the tool.

  1. Flask as a backend framework: Python’s Flask framework is lightweight and easy to deploy-able web framework.
  2. React as a Frontend framework: Since this tool has to manage lots of data and we will make lots of Ajax requests to edit/create/delete then it will be very hard to manage DOM (HTML) elements by just vanilla JavaScript or jQuery. I decided to take Facebook’s React framework as Frontend.
  3. Material-UI as UI Component: Material design is dominating nowadays. Websites such as Gmail, Reddit, Dropbox, and Pinterest are using Material design.


First Mockup


In the sixth week, I mainly worked on two things.

  1. wikiApi.js module: In order to make the tool component modular, I wrote a WikiApi module which was a helper function library. This module contains things like making SPARQL query requests to get items.
  2. Basic backend: Previous week, I decided to take Flask as a backend framework. So this week, I actually wrote code for OAuth in the backend. This was not challenging for me as my other toolforge tools are also based on OAuth but the tricky part was that we do not just need to authenticate but also make the edits on Wikidata with user access token and their session.
    1. /
    2. /login
    3. /logout
    4. /oauth-callback
    5. /api/profile
    6. /api/editform

Both work has been done in the sixth week.

16 Dec 2020 - 31 Dec 2020

edit

Seventh week did not go as per plan. I had some medical problems during this period. I have notified my manager Tito Dutta Ji. The only thing, I did, was basic app deployment on 23 Dec 2020 and made an edit by tool after OAuth. See Lexeme:L342662.


bodh after deployment on 23 Dec


In the eighth week of my internship, I extensively wrote the backend to include the following Wikidata API routes.

  1. /api/createform
  2. /api/createsense
  3. /api/deleteitem
  4. /api/editsense


I added flake8 testing to the backend for continuous integration/development. Apart from that, I had one video call and one telephonic conversation with Bodhisattwa Mandal Ji in this week to understand column structure for the frontend so that I can start work on the frontend just after completing the backend without any delay. I almost finished the backend work this week.

Future work

edit
  • Work on frontend
  • Take the Wikimedia Gerrit repo for the tool.
  • Make Phabricator tool component
  • Get OAuth consumer credentials
  • Add tool to Wikimedia’s Jenkins CI/CD