23
loading...
This website collects cookies to deliver better user experience
hydra:Collection
. New functionalities were added to effectively update, get or delete particular members from a Collection without actually sending the whole collection in the request payload. A lot of improvements were made in CRUD operations of hydrus, including setting up constraints and handling errors on the server-side depending upon how the data is stored. The project also aims to enhance the functionality of hydrus, optimize existing codes and keep it synced with upgrades and development in hydra-python-core and Hydra specifications. Some major changes were made in the test suite and even more tests were added for CRUD operations. New features were added to support different datatypes in hydrus and provide technical support for OpenRisk's Banking API project.List of deliverables and major tasks completed
Added support to get/update/delete members of a collection
GET: /<api_name>/<collection_name>/<collection_id>/<member_id>
DELETE: /<collection_name>/<collection_id>/delete/<member_id>
The next step was allowing the same for deletion of multiple members from the Collection. I created something similar for Collections as well. The endpoint I created would take name of the collection and a list of object ids as a parameter.
/<api-name>/<resource_name>/<collection-id>/delete/<ids_list>
/<api-name>/<resource_name>/<collection-id>?instances=<ids_list>
{
"@context":"https://www.w3.org/ns/hydra/core",
"@type": "Status",
"description": "Objects with ID ['id1','id2'] successfully added",
"iri": ["id1","id2"],
"statusCode": 201,
"title": "Objects successfully added"
}
/serverapi/Movie?instances=id1,id2,id3
{
"@context":"https://www.w3.org/ns/hydra/core",
"@type": "Status",
"description":"Objects with ID ['id1','id2'] successfully deleted",
"statusCode": 200,
"title": "Objects successfully deleted"}
}
This issue was about creating a foreign-key relationship between a hydra:Class and hydra:Collection
manages
keyword to check if a hydra:Collection
actually manages that Class.Previously, all database columns were set to String as there was no way of specifying the type of variable for a hydra:supportedProperty.
I discussed the implementation in a weekly meeting with mentors and came up with the final approach which was using range keyword to specify the type of a supported property. range
keyword can be used to specify the datatype of a property according to Hydra specifications. We already have hydra:range (which is also inherited from rdfs:range) in our API documentation’s context.
"range": {
"@id": "rdfs:range",
"@type": "@id"
}
At this point, only integer, float, string were supported datatypes in database.
response.location
to get IDs of created objects throughout the tests.os
module to env variables from docker-compose file and used uwsgi.ini
to run the server using nginx. PR Link | Description | Status |
---|---|---|
#554 | Added new endpoint to Get/Delete member of a collection. | Merged ✅ |
#578 | Update docs and fixed fragments test. | Merged ✅ |
#580 | Added endpoint to delete multiple members from a Collection | Merged ✅ |
#590 | Changed endpoint format for GET,PUT, DELETE for multiple objects of Class and Collections | Merged ✅ |
#591 | Added functional tests for PUT/DELETE multiple class objects | Merged ✅ |
#593 | Added foreign key relationship between a Collection and managed Class | Merged ✅ |
#594 | Added support for datatype for columns in database tablesn | Merged ✅ |
#597 | workflow using GitHub Actions to publish release on PyPi | Merged ✅ |
#599 | Added support for datetime column in datebase | Merged ✅ |
#601 | Changes in tests in hydrus : removed regex | Merged ✅ |
#603 | Fix get_host_domain function for deployment | Merged ✅ |
#81 | Changed resource URI format in hydra-python-core | Open |
#84 | Modified doc_maker and updated sample docs | Merged ✅ |
#91 | Added support for datatype(range) in supported properties | Merged ✅ |
#93 | Added tests in hydra python core | Open |
#25 | Dockerize creditrisk_pocon | Merged ✅ |
#26 | remove apidoc path environment variable from docker compose | Merged ✅ |