Page MenuHomePhabricator

GSOC-2017 Proposal for “Add a hierarchy type to the Cargo extension”
Closed, ResolvedPublic


Final Project Report : T174294
Proposal's Google Doc Link : Link

Profile Information

Name : Feroz Ahmad
IRC : fz-29
MediaWiki Username : Fz-29
Resume :
Personal Webpage/Portfolio :
Blog :
Github :
Location : New Delhi, India
Typical Working Hours : 12 P.M. - 9 P.M. IST (UTC+05:30)


This project aims to introduce hierarchy fields in Cargo MediaWiki extension. This project will enhance the capability of MediaWiki by enabling efficient storage and querying over information which is hierarchical in nature, such as following piece of information :
Chapter Name > Topic > Sub-Topic
Project also involves addition of support for hierarchy fields in Page Forms MediaWiki extension, to ensure easy input from users entering hierarchy data into the wiki as well as to maintain compatibility with frequently used helper pages.

Possible Mentors : @Nischayn22, @Yaron_Koren, @Oetterer


The project involves certain challenges in backend database implementation and input design for hierarchy fields that is coupled with another extension which is Page Forms.
Project demands storage of hierarchical data, not only for page display but also for querying hierarchy data using the cargo wrapper around SQL. This calls for choosing a suitable implementation from database theory for efficient storage and querying as per the use case. As per discussions with the project mentor, Mr. Yaron Koren, the problem is still open ended on how much liberty can be provided in the type of hierarchy. In case of well structured & predefined hierarchy, we have prior knowledge of max depth in hierarchy. In such demands efficient queries can be easily constructed by opting certain implementation. On contrary, in case of less structured & arbitrary tree like hierarchy, the max depth is liable to change anytime in future entries. Here the primary demand is scalable database architecture for levels in hierarchy, which is trade off for efficient queries.

Page Form extension support is essential for easy user experience while dealing with hierarchy fields and enumerations. Page forms already has tree implementation defined, but it currently demands for bridging the gap for using hierarchy fields of Cargo Extension.


For efficient storage and query, in case of predefined hierarchy, I have currently explored the modified multiple lineage column implementation as depicted by an example in figure 1. In case of arbitrary tree like hierarchy which may have future scalable needs, I have explored Adjacency List implementation as depicted in figure 2. I have discussed these approaches with my mentor, and he has suggested to continue to explore further and hence we will be finalizing before the coding period starts.

figure1.png (529×1 px, 79 KB)
Figure 1

figure2.png (530×1 px, 49 KB)
Figure 2

As there lies no support regarding input for arbitrary hierarchy in Page Forms, I have proposed an input method as in figure 3.

Also how to represent hierarchy field on Special:Drilldown page is depicted in figure 4.

figure3.png (768×1 px, 63 KB)
Figure 3

figure4.png (768×1 px, 65 KB)
Figure 4


Prep Task

  1. Understand MediaWiki, Cargo Extension and Page Forms Extension. [Done]
  2. Understand how to contribute at Wikimedia and learn various conventions. [Done]
  3. Perform micro-task T160687 and submit a few patches. [Done]
  4. Understand Cargo Extension architecture for its data storage. [Done]
  5. Explore various implementations for storing hierarchy data.


  1. Discuss available implementations to efficiently store and query hierarchical data according to the features provided by the cargo extension, with mentors.
  2. Add support for declaring and querying over hierarchy fields in Cargo Extension.
  3. Add support for query using new Cargo keyword - “WITHIN”.
  4. Modify Cargo’s Drilldown interface to incorporate hierarchy fields.
  5. Add support for hierarchy fields in the Page Forms extension to set default input type as tree for hierarchy field.
  6. Add support for hierarchy fields in the helper pages of Page Forms extension for compatibility with Special:CreateClass and Special:CreateTemplate.

Work for each objective will be initialized after rigorous discussion with mentors. Each objective will be completed after performing appropriate unit tests, as per the MediaWiki Manual. All the visible bugs discovered by bug-tests shall be fixed before moving on to next objective.


1. First Phase
Create the minimum viable product with hierarchy field creation, its efficient storage, and ability to query hierarchy data using ‘WITHIN’ keyword.
2. Second Phase
Product with modified Special:Drilldown interface to incorporate hierarchy field display and provide support in Page Forms MediaWiki extension to identify right input type for hierarchy data.
3. Final Phase
Complete project with hierarchy field support in Cargo and as well as in Page Forms helper pages, with documentation of the work performed.

Proposed Schedule (Timeline)

Week From ToTasks to be done
4 April3 MayGet more familiarized with code while solving more issues, brush up database management skills.
4 May29 MayCommunicate with mentors, communicate with other WikiMedia participants of GSoC to know them and their projects, explore various implementations for storing hierarchical data.
130 May5 JuneFinalize the database schema implementation for hierarchy field, begin PHP coding for 'hierarchy' keyword support in template
26 June12 JuneWrite and Optimize SQL queries to perform on-demand changes in Cargo's database schema to support hierarchy type, implement basic query over Hierarchy Field
313 June19 JuneImplement query using WITHIN keyword, perform code refactoring and write unit tests, take mentors' feedback on product so far
420 June26 JunePerform exhaustive testing, incorporate mentors' feedback, make submission ready for first phase evaluation, perform side by side documentation of the project so far
26 June30JunePhase 1 Evaluation
527 June3 JulyGet familiarized with Drilldown code. Write SQL queries and PHP code to display simple hierarchy field in Drilldown
64 July10 JulyExtend the above to implement nested/recursive SQL queries to display and query general hierarchy fields, perform code refactoring and write unit tests
711 July17 JulyModify Page Forms to identify right input type(tree) for hierarchy field in the template, take mentors' and community feedback, perform documentation of the project so far
818 July24 JulyIncorporate Mentors' feedback, perform exhaustive testing of product so far, perform code refactoring, make submission ready for second phase evaluation
24 July28 JulyPhase 2 Evaluation
925 July31 JulyAdd support for hierarchy field in CreateTemplate, take feedback and incorporate feedback, perform documentation
101 Aug7 AugAdd support for hierarchy field in CreateClass, take feedback, perform documentation
118 Aug14 AugIncorporate feedback, refactor code, perform Full Scale Testing, perform required bug-fixes, complete project according to submission guidelines
1215 Aug21 AugBuffer Time, complete the documentation, perform any other bug-fixes if needed, be active on IRC and ask for community feedback
21 Aug29 AugFinal Evaluation


  • Weekly Project progress will be updated on the project progress page
  • Communication with mentors will be done on Phabricator and Email. Timing would be around 10PM IST. (UTC+5:30). I will be interacting with other contributors on IRC and Phabricator. I will be available on channel #wikimedia.

About Me

Education and Work Experience

Currently I'm pursuing Bachelor of Technology in Computer Engineering at Delhi Technological University, New Delhi, India.
I work as Research Assistant at Vision and AI Research Lab, at Delhi Technological University. Apart from that I'm an active member of IEEE-DTU section where I mentor my junior college mates on their projects and also manage the web division team.
Recently, in February 2017, I finished my winter training (internship) at Defence Research and Development Organisation.

Why contribute in Wikimedia?

From the time we had the access to the internet, we have been using open source products knowingly or unknowingly. We have been benefitted from all those initiatives, such as Wikipedia. I have used it as a constant source of information for learning and preparing projects. Now it’s the time to give back, and contribute. Contributing to Wikimedia makes me excited, as I believe my contributions will have an impact on the lives of people through the sites which are powered by Wikimedia’s projects.

Why I am the right person for this project?

This project requires sound experience of Database Management Systems and PHP. Being a third year, Computer Engineering undergraduate student, I have taken a course on Database technologies in recent semester. I have performed various team, individual and semester projects (as listed in Work Experience section) which employed PHP and several database technologies such as MySQL, SQLite etc.
One of my projects - Quizzing Platform MIST - has been in production and have been enjoyed by nearly 1,500 users with 65,900 pageviews. I have optimized content delivery for a flicker free experience. Also implemented persistent O'Auth login in PHP from scratch.
For efficient performance of Online Stock Trading Simulator Project in production environment, I have analyzed all SQL queries to be most effective in order to provide real time experience to players.
In addition to this, the project involves concept of hierarchies in DBMS, for efficient representation and optimized querying over hierarchical data, which I have explored a lot recently with my mentor, Mr. Yaron Koren.

Past Coding Experience

Contribution to Wikimedia

Submitted patches for 2 bugs.
T160687 - Patch [Accepted and merged]
T159405 - Patch

T160687 was assigned to me as a microtask by Yaron Koren. He also guided me with the contribution practice followed at Wikimedia projects.

Development under IEEE Delhi Technological University Section

Competitive Quizzing Platform MIST
PHP Web Application developed for Online Quizzing Event - MIST - hosted by IEEE-DTU, focused on optimized multimedia delivery for a flicker‐free experience. Enjoyed by 1,500 users, producing 65,900 pageviews. The application was in production for more than 1 week.

IEEE DTU Website Management
I have been managing official website of IEEE DTU and its annual technical fest Troika, from Jan 2015 to June 2016. Various tasks performed by me are website development, deploying over VPS, regular upgrades in website and bug fixes. Several tasks here require knowledge of cron jobs and database management techniques for required normalization of databases. Now I guide and mentor my fellow juniors at the university. Technologies involved are PHP, jQuery, MySQL.

Online Stock Market Simulation
I have developed this simulator for online event - Virtual Online Stock Market - Bulls n Bears - hosted by IEEE-DTU for 2 consecutive years. First time I coded the application in PHP and handcrafted all SQL queries to simulate a stock market. For the next year, we decided to go with Django Web Framework with Angular Front End. The application in both the years was in production for a span of 3 days under annual cultural fest of Delhi Technological University, Troika.

Training at Defence Research and Development Organisation (DRDO), New Delhi

Worked on several cryptanalysis algorithms and learnt about several attacks on current encryption algorithms being used. I also underwent 2 days professional training by Intel at DRDO for optimizing parallel codes. I also optimized openMPI implementations of certain cryptanalysis algorithms using Intel Parallel Studio.

Experience in Wordpress CMS

Co-founded and deployed following 4 blogs over VPS, for affiliate marketing. I also perform regular site maintenance and routine bug fixes. [now acquired] [now acquired]


Programming Languages : PHP, Javascript, C++, Python, Java
Frameworks : Django, Flask, jQuery, Bootstrap
Database: MySQL, Oracle SQL

GSOC Information

Have you participated in Google Summer of Code in the past? No.
Have you applied to GSoC in the past? No.
Are you applying to any other organizations this year? No.
How many hours will you devote to your GSoC project each week? I plan to work at least 8 hours every weekday and one of the weekend.

Event Timeline

Fz-29 removed Fz-29 as the assignee of this task.Mar 28 2017, 5:40 PM
Fz-29 claimed this task.
Fz-29 updated the task description. (Show Details)
Fz-29 added a subscriber: Oetterer.

@srishakatux, I just noticed that I by mistake moved this task from proposal in progress to proposal submitted. I later noticed that you did this for other people's task. I m sorry, please see if you need to make a record or perform certain other actions while you do the same for other people's task. Thanks.

Hierarchy is an important type which is already supported by other extensions like Semantic Hierarchy. Originally, there was no support for hierarchy in Cargo Extension. This GSoC project has aimed at adding support for hierarchy type in the Cargo Extension.

Features added in Cargo Extension:

  • "cargo_declare" command recognises "hierarchy" in field description
  • Implemented database schema for storing hierarchy data efficiently
  • Added Query command - "WITHIN" and "HOLDS WITHIN" for performing queries over hierarchy fields.
  • Enhanced Special:Drilldown to perform the filtering of hierarchy in a true drill down sense

Features added in Page Forms Extension:

  • Added support for hierarchy fields in Page Form extension by setting default input type in forms as Trees.
  • Added support for creating hierarchy fields via. Special:CreateTemplate and Special:CreateClass

During the development, some bugs already existing in the code were found and appropriately fixed. You can find complete list of contributions at T174294

I don't know why this is still open... it's time to resolve it!

Please for the Gsoc, am I required to use one of wikimedia's outreach projects?

Please for the Gsoc, am I required to use one of wikimedia's outreach projects?

@Tamgue: What does "use an outreach project" mean exactly? See for general information and also for where to ask questions. This task is closed and from last year.

I meant the list of projects. I have gotten a solution