Post on 30-May-2020
transcript
Hydra: Hypermedia-
Driven Web APIsMARIUS MÖSSMER
APRIL 30, 2014
Abstract
Hydra
is a lightweight vocabulary to create hypermedia-driven Web
APIs
it enables the creation of generic API clients
Authors
Markus Lanthaler, Graz University of Technology
Christian Gütl, Curtin University of Technology
Basic ideas of Hydra
With Hydra, a server is able to publish all possible state transitions a client
can perform on the server
Data is enriched with machine-readable semantics which enable interaction
Hydra APIs base upon
REST architectural style
HTTP
Building blocks of Hydra
Hydra consists of two fundamental parts:
JSON-LD
It’s the serialization format used in the communication between the server and its clients
Hydra Core Vocabulary
represents the shared vocabulary between server and client
JSON-LD
http://www.w3.org/TR/json-ld/
JSON-LD stands for Javascript Object Notation – Linked Data
JSON-LD is an extension of JSON
JSON-LD is a serialization-format
Use-cases:
Enables the expression of linked data
Makes data self-descriptive
JSON-LD
Simple JSON-document that represents a user-entity:
JSON-LD
Extended JSON-LD-document that represents a user-entity with meaningful
semantics:
Hydra Core Vocabulary
A small vocabulary extending RDF Schema ( http://www.w3.org/TR/rdf-
schema/ )
Hydra Core Vocabulary is used to
describe an application-domain with semantic aspects
express the behaviour of the Web-API
Hydra Core Vocabulary
Simple example: issue-tracking-system
GET http://example.com/issues/123
What‘s the model of comments
or how to add comments ?
Hydra Core
Vocabulary
GET http://example.com/api/vocab
Model of a comment-entity
Hydra Core
Vocabulary
GET http://example.com/api/vocab
Supported Operations
Hydra Core
Vocabulary
Full Overview
Hydra Project
Hydra W3C Community Group (http://www.w3.org/community/hydra/)
Mailing List
Wiki
Chat
Implementations
HydraBundle: a bundle for Symfony2 to create Web APIs based on Hydra
HydraConsole: a generic API console for Hydra-powered Web APIs
HydraClient: a PHP client library to access Hydra-powered Web APIs
Sources
http://www.hydra-cg.com/spec/latest/core/
http://www.w3.org/TR/json-ld/
http://www.w3.org/TR/rdf-schema/
http://www.markus-lanthaler.com/hydra/
M. Lanthaler and C. Gütl, “Hydra: A Vocabulary for Hypermedia-Driven
Web APIs”, 2013