DSpace 7: Open for Integration Open Repositories 2019, Hamburg, June 10-13 Andrea Bollini, 4Science Luigi Andrea Pascarell, 4Science
About To adopt a Repository-as-a-Service model, support different users and communities, it is crucial to be able to interact with the repository with different, unanticipated patterns and modalities embedding the repository in existing workflows, connecting and combining tools.
Why a new REST API? Not based on current Covers only a subset of 4.x - 6.x REST best practices DSpace functionality or standards No search No submit / workflows Limited admin operations Limited write / delete (4.x was read only) Handcrafted in Jersey, while most DSpace code uses Spring technologies
Why a new REST API? All features MUST 7.x be in REST API Defined REST Contract . (for Angular UI) HATEOAS, ALPS, HAL format Bonus: better third-party { REST } app integration! Built using Spring technologies (Spring Boot, MVC, HATEOAS)
REST Maturity Level ALPS = Application Level Profile Semantics Be specific about your expectation and promise HAL = Hypertext Application Language (JSON or XML) Talk a simple standard language { REST } HATEOAS = Hypertext As The Engine Of Application State Allow the client to discover the “next step” Image from: https://martinfowler.com/articles/richardsonMaturityModel.html
Interacting with a REST API You can use the command line… curl "https://dspace7.4science.cloud/dspace-spring-rest/api" But, there are better ways… using a REST client
HAL Browser • The Official REST Demo public instance (provided by 4Science) https://dspace7.4science.it/dspace-spring-rest/ – • Navigate to the link above to explore
Request + Headers
Response Headers HTTP Status code
Response Body RAW JSON Response The HAL Browser will parse the key elements: _links _embedded Everything else
HAL Document
Response Properties
Links: All endpoints are available from the Entry Point
Communities Endpoint Response Communities endpoint Pagination properties
Links - A generic approach to paginated results
Embedded Community Properties
Embedded Community Links
Right use of the HTTP Verbs On a COLLECTION Endpoint (“set of all” items, communities, etc.) POST Adds a new element to the collection - GET Returns the first page of the resources in the collection - On a single RESOURCE Endpoint (specific item, collection, etc) GET Returns a single entity - HEAD Returns whether the item resource is available - PUT Replaces the state - PATCH Similar to PUT but partially updating the resources state - DELETE Deletes the resource exposed -
Reliable, stable and automatically tested ● uniform, consistent and self-documented behaviour ● full functional coverage, both for anonymous user and privileged users ● stable, well documented and fully tested solution so that integration will not easily break from one version to another ○ Test-Driven Development ○ Contract first approach 76% Test Coverage, mainly Integration Test { REST }
Supported Integration Scenarios
Reuse of the information Embedding Javascript code Complete backend integration “Badge” in personal websites with search, browse, editing capabilities { REST } List of departments and research group publications
Data acquisition { REST }
Data acquisition raw { REST }
Wide Institutional Process - Theses An external Anti-Plagiarism Fill form to request Thesis system will analyze the assignation in the Student Thesis Management System { REST } { REST } Graduation { REST } recorded in the Student Management Student completes the Advisor approves System submission uploading the Thesis in the repository
More and more 1. quick prototyping end users functionalities a. notification services of pending tasks, unfinished submissions, … b. reporting tools: usage, content and workflow statistics 2. extraction and external batch processing of the data in the developer preferred programming language 3. data crawling and enrichment … there are indeed no limits to the integrations that can be implemented
Do you want to talks with DSpace? «Alexa, ask DSpace demo for «Alexa, ask DSpace demo to search the number of items» for molecular » «Alexa, ask DSpace demo for information about John Smith»
Andrea Bollini, 4Science andrea.bollini@4science.it https://orcid.org/0000-0002-9029-1854
Recommend
More recommend