Skip to content

[3655] an example of CRUD REST endpoint for geolocations, continents, and us-states

Created by: chenejac

VIVO GitHub issue: 3655

linked issues - 3721, 3720

linked PR - PR

What does this pull request do?

Add an example of dynamic actions for CRUD operations over geolocation

What's new?

two n3 files have been added, one is for APIInformation (needed for generating OpenAPI specification), and the another one for geolocationAPI

How should this be tested?

There are endpoints for geolocation, continent and stateOrProvince. Below are examples of HTTP requests for geolocation API.

fetch all geographic locations

GET http://localhost:8080/vivo/api/rest/1.0.0/geolocation/

there is an issue with format of total counts of records - see the issue 3721

adding new geographic location

POST http://localhost:8080/vivo/api/rest/1.0.0/geolocation/ In the HTTP body should be: { "label": "a test geolocation@en-US", "uri": "http://dbpedia.org/resource/TestCountry" }

GET http://localhost:8080/vivo/api/rest/1.0.0/geolocation/ TestCountry should be at the end

getting one geographic location

GET http://localhost:8080/vivo/api/rest/1.0.0/geolocation/resource:aHR0cDovL2RicGVkaWEub3JnL3Jlc291cmNlL1Rlc3RDb3VudHJ5

Return one geolocation (TestCountry)

fetch geographic locations with pagination (limit and offset are mandatory, don't support limit without defined offset)

GET http://localhost:8080/vivo/api/rest/1.0.0/geolocation/?limit=10&offset=20

NOT WORKING

fetch geographic locations with sorting (sort by and order are mandatory, don't support sort by without defined order, see the issue description )

GET http://localhost:8080/vivo/api/rest/1.0.0/geolocation/?sortBy=limit&order=ASC

deleting (resolved in PR )

DELETE http://localhost:8080/vivo/api/rest/1.0.0/geolocation/resource:aHR0cDovL2RicGVkaWEub3JnL3Jlc291cmNlL1Rlc3RDb3VudHJ5

editing (resolved in PR )

PUT http://localhost:8080/vivo/api/rest/1.0.0/geolocation/resource:aHR0cDovL2RicGVkaWEub3JnL3Jlc291cmNlL1Rlc3RDb3VudHJ5 In the HTTP body should be: { "label": "a test geolocation changed label@en-US", "uri": "http://dbpedia.org/resource/TestCountry" }

Interested parties

@VIVO-project/vivo-committers, @wwelling

Merge request reports