My 3rd Week of the GSoC’21

From this blog, I will explain what I did in my third week of the GSoC’21. As you can remember from my previous blog, this week I have to make sure that all JSON message outputs of KBox have to follow the same structure as below.

{
"status_code": HTTP_CODE
"message": "information or error message"
"result": [expected resutls as a json array]
}

To achieve this I created a newer class called JSONSerilizer. So that I can handle the converting of all the outputs into json format in this class. Hence it will follow both the open-close principle and single responsibility principle.

After doing the necessary modifications, the final outcome looked like this

java -jar kbox.jar -list -o json{
"status_code": 200,
"message": "visited all KNs.",
"results": [
{
"name": "http://purl.org/pcp-on-web/dbpedia",
"format": "kibe",
"version": "c9a618a875c5d46add88de4f00b538962f9359ad"
},
{
"name": "http://purl.org/pcp-on-web/ontology",
"format": "kibe",
"version": "c9a618a875c5d46add88de4f00b538962f9359ad"
},
{
"name": "http://purl.org/pcp-on-web/dataset",
"format": "kibe",
"version": "dd240892384222f91255b0a94fd772c5d540f38b"
}
]
}
java -jar kbox.jar -list -kns -o json{
"status_code": 200,
"message": "KNS table list",
"results": ["https://github.com/AKSW/KBox/tree/master/kns/2.0"]
}
java -jar kbox.jar -install -kns https://github.com/AKSW/KBox/tree/master/kns/2.0 -kns -o json{
"status_code": 200,
"message": "KNS installed.",
"results": [true]
}
java -jar kbox.jar -remove https://github.com/AKSW/KBox/tree/master/kns/2.0 -kns -o json{
"status_code": 200,
"message": "KNS removed.",
"results": [true]
}
java -jar kbox.jar -info http://purl.org/pcp-on-web/dbpedia -o json
{
"status_code": 200,
"message": "Information has been fetched.",
"results": [{
"License:": "[\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License\",\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\"]",
"version Tags:": ["latest"],
"Format:": "kibe",
"KN:": "http://purl.org/pcp-on-web/dbpedia",
"label:": "PCP-on-Web ontology",
"Owner:": "PCP-on-Web",
"KNS:": "https://raw.githubusercontent.com/AKSW/kbox/master/kns/2.0",
"Version:": "c9a618a875c5d46add88de4f00b538962f9359ad",
"Publisher:": "KBox team"
}]
}
java -jar kbox.jar -search ontology -o json
{
"status_code": 200,
"message": "searching completed.",
"results": [{
"name": "http://purl.org/pcp-on-web/ontology",
"format": "kibe",
"version": "c9a618a875c5d46add88de4f00b538962f9359ad"
}]
}
java -jar kbox.jar -r-dir -o json
{
"status_code": 200,
"message": "Your current resource directory is: /home/sahandilshan/.kbox",
"results": ["/home/sahandilshan/.kbox"]
}
java -jar kbox.jar -version -o json
{
"status_code": 200,
"message": "KBox Version.",
"results": ["v0.0.2-beta"]
}

This was the final output of the KBox. After this, I had the weekly meeting with my mentors and made the plans for the upcoming week.

Task for the upcoming weeks:

GSoC 2021 Student