Nadir Saghar, Tony Pan, Ashish Sharma REST for Data Services.
-
Upload
warren-west -
Category
Documents
-
view
221 -
download
0
Transcript of Nadir Saghar, Tony Pan, Ashish Sharma REST for Data Services.
Nadir Saghar, Tony Pan, Ashish SharmaREST for Data Services
Motivation
• caBIG IMG TCGA Radiology Enterprise Use Case Phase I Pilot Project
Multiple Radiologists read MR images from NBIA and make annotation in AIM format. The AIM annotation documents are stored in and retrieved from AIME caGrid Data Service
Multiple review client applications (Osirix IPAD on Mac, ClearCanvas on Windows, XIP on Windows/Linux) requiring connectivities to caGrid services (NBIA, AIME)
The Language Barrier
• Problem:– Osirix iPAD is ObjectiveC based
– ObjectiveC’s java support is limited
– ObjectiveC’s support for SOAP is limited
– A native grid service client in ObjectiveC would require investigation, time, and personnel that were not available from the project
• Solution:– Create a HTTP RESTful service proxy to the AIME
caGrid data service
– Osirix iPAD (ObjectiveC) then use the RESTful API to access the caGrid service.
RESTful Services
• An architecture style, unlike SOAP (a messaging “standard”)
• Representational State Transfer– each URL is a representation of an object– Stateless– Content typed via MIME
• Operations on the objects are performed through standard HTTP methods– get, post, put, delete– May be mapped Create, Retrieve, Update, and Delete
operations
• Leverages ubiquitous support for HTTP, browser compatibility• Well known adoptors: Yahoo, eBay, Amazon, Facebook
RESTful Service Design Consideration
• As a style, RESTful API designs vary, and can easily carry different approaches of information modeling and behavioral semantics from application to application
• Example 1:– http://host/Annotation lists the available annotations– http://host/Annotation/1 retreives annotation with id=1
• Example 2:– http://hostA/Annotation + HTTP post queries annotation– http://hostB/Annotation + HTTP getqueries annotation
• Result– non-computable API so no computable interoperability– Higher degree of manual effort to document and adopt API
TCGA Radiology Phase 1 RESTful Service Impl
• SUCCESS!
Osirix IPAD can interact with AIME caGrid Data Service through a RESTful Service proxy
• Manually implemented URLs and HTTP methods to support:– List annotation identifiers (HTTP get)– Retrieve annotation by identifier (HTTP get)– Submit to grid service (HTTP put)– Full CQL query support (HTTP post)
• Bonus: Web Browsers can access caGrid Data Service content directly– track reader progress in TCGA Radiology Phase II
BUT WAIT, THERE IS MORE…
Automated RESTful Service Creation?
• Can we automate the generation of RESTful service from a caGRid data Service?
– Is there sufficient information for the automation?
– Is there enough expressivity in the RESTful style and HTTP methods to fully proxy caGrid Data Service capabilities, specifically CQL?
RESTful Service Generation Tool (RSGT)
• Can we automate the generation of RESTful service from a caGRid data Service?
– Is there sufficient information for the automation?
YES
– Is there enough expressivity in the RESTful style and HTTP methods to proxy caGrid Data Service capabilities, specifically CQL?
PARTLY
Architecture of the REST CodeGen Framework
Key Features
• Minimal amount of user intervention– Eclipse IDE plugin to facilitate RESTful service generation
and deployment
• Generation– User supply the grid service source tree, domain model,
and where to put the generated code
– RSGT does the rest
– User can optionally modify the generated code
• Deployment– User supply the grid service URL, the tomcat container
– RSGT does the rest
Generated RESTful Service
• Deployable as .war
• Two classes of operations are generated– One to One mapping for caGrid Service operations.
• URL is suffixed with name of operation, e.g. Query
• Complex objects like CQL xml are passed along using HTTP POST and PUT
• For advanced operations
– One to One mapping for service domain model classes• URL is suffixed with name of class, e.g. Patient
• Retrieve only URL using HTTP GET
• URL can be appended with attribute filters
• Retrieve in XML, JSON, CSV, and HTML formats
Technologies Used by RSGT
• Apache Velocity for template-based code generation
• Apache Ant for scripting
• Eclipse plugin for user interface
• JAX-RS for RESTful
• Introduce generated artifacts
• caGrid 1.2/1.3
USAGE
Demo: Add RSGT Plugin to Eclipse
http://storage01.cci.emory.edu/mnt/vg1/repos/Drop-Box/caGridRSGTUpdateSite/
Demo: Add RSGT Plugin to Eclipse
http://storage01.cci.emory.edu/mnt/vg1/repos/Drop-Box/caGridRSGTUpdateSite/
Generate RESTFul Service
Provide caGrid-Service Location and Domain Model
Provide RESTFul Service Information
Customize REST Service (optional)
Deploy Service
Deploy Service: Provide URL of the caGrid Service
Food for thought
• RESTful service API provides a simple and fast way to access data through URLs and web browsers
• Complex operations/interactions with the service require sending parameters (e.g. CQL) via HTTP Headers– Hard to impossible to formulate a query TREE in URL
– Not browser compatible
• Interpretation of RESTful architecture style results in different API (URL and HTTP operation) patterns and behaviors
• No formal standard for computable description and documentation of RESTful APIs
• REST is easy to build, hard to consume programmatically
Future Directions
• Security– Proxy for secure grid services– Integration with WSSO
• Formal description of RESTful API for computable interoperability
• RESTful API best practices?• More flexible result transform, perhaps through user
supplied XSLT– More user and web browser friendly (prettier) “views” of
the data
• Documentation and Eclipse plugin information at https://web.cci.emory.edu/confluence/display/INCUB/RESTful+Interfaces
QUESTIONS