Create database schema in FOSSology application.

What are fossology Agents and modify or create a schema in fossolgy application

Agents in FOSSology

In FOSSology Agents are used to perform analysis, statistics, or management tasks related to anything in the database. The best practice is each agent performs one task, you should not overload agent functionality. For three different tasks, three different agents should be created. The agents play a crucial part in FOSSology project. A various task like unpacking, copyright searching, license listing etc. are done through agents in FOSSology. In simple words, agents are nothing the functionality through which the tasks are being performed. In FOSSology you can write the agents in PHP, c or in python.
My task is to integrate Software Heritage in fossology. Software Heritage is an open-source platform which holds the records of various files that are hosted on the web. My job is to fetch the origins of the files of a package from software heritage and store it in the fossology DB.
In this topic, I am going to discuss the shema structure of software_heritage table and what each attribute is going to store.

Database Structure for Software Heritage

You can view the database structure in the below table definition. Also, I am going to give a brief description in fossology how are you going to add a new database schema.

As you can see here the primary key is software_heritage_pk, pfile_fk is the foreign key and other two columns license and origin holds the records from the software heritage.

Developer Section

How the make the changes in fossology project
There is a core-schema.dat which is situated in the directory of fossology/src/www/ui/core-schema.dat you need to add the basic functionality of the table to make the table in fossology. You don't need to create the table explicitly. You just need to add the basic structure of the table. The fossology will do everything by itself. I will tell you the installation process through a vagrant configuration or in a virtual box configuration.
The database configuration contains three steps

Defining the table structure

Creating a sequence for the primary key

Add the foreigin key constraint.

You can refer to my own code or other code from the core-shema.dat file.

Run the changes

You need to go to the root directory of the fossolgy in the virtual engine

Do a sudo make install

Then sudo ./install/fo-postinstall

For now this much is enough. If you get to doubt the please inform me through the contact now section contact me

printf(“Happy!, Coding”);
printf(“Sandip”);

Sandip Bhuyan

Young Developer

Currently working as a intern in Google Summer of Code for Free and Open Source Silicon Foundation.
Algorithm enthusiastic, With two years of experience in web development, real Time application development and javascript lover and rest you will know on our meeting.