SlideShare ist ein Scribd-Unternehmen logo
1 von 58
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
http://example.com/events/oscon2014
{
69 64: 6F 73 63 6F 6E 32 30 31 34 0D,
74 79 70 65: 45 76 65 6E 74 0D,
6E 61 6D 65: 4F 53 43 4F 4E 0D,
64 65 73 63 72 69 70 74 69 6F 6E: 4F 27 52 65 69 6C 6C …
73 74 61 72 74 44 61 74 65: 32 30 31 34 2D 30 37 2D 32 …
65 6E 64 44 61 74 65: 32 30 31 34 2D 30 37 2D 32 34 54 …
6C 6F 63 61 74 69 6F 6E: 4F 72 65 67 6F 6E 20 43 6F 6E …
6F 72 67 61 6E 69 7A 65 72: 4F 27 52 65 69 6C 6C 79 0D
}
http://example.com/events/oscon2014
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"@context": {
"name": "http://schema.org/name",
"description": "http://schema.org/description",
"startDate": "http://schema.org/startDate",
...
},
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
"@context": {
"@vocab": "http://schema.org/"
},
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
"@context": {
"@vocab": "http://schema.org/"
},
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
"@context": {
"@vocab": "http://schema.org/"
},
"@id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
"@context": {
"@vocab": "http://schema.org/"
},
"@id": "oscon2014",
"@type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"@context": {
"@vocab": "http://schema.org/",
"startDate": { "@type": "DateTime" }
},
"@id": "oscon2014",
"@type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"@context": {
...
"startDate": { "@type": "DateTime" }
"id": "@id",
"type": "@type"
},
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"@context": "/contexts/event.jsonld",
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
http://example.com/events/oscon2014
HTTP/1.1 200 OK
Content-Type: application/json
Link: </contexts/event.jsonld>;
rel="http://www.w3.org/ns/json-ld#context";
type="application/ld+json"
{
"id": "oscon2014",
"type": "Event",
"name": "OSCON",
"description": "O'Reilly Open Source Convention 2014",
"startDate": "2014-07-20T16:00:00Z",
"endDate": "2014-07-24T21:00:00Z",
"location": "Oregon Convention Center",
"organizer": "O'Reilly"
}
<script type="application/ld+json">
...
</script>
http://example.com/events/
{
"@id": "/events/",
"@type": "Collection",
"member": [ ... ],
...
"operation": {
"@type": "http://schema.org/AddAction",
}
}
{
"@id": "Event",
"@type": "Class",
"supportedProperty": {
"property": "name",
"required": true
}
}
http://example.com/events/
{
"@id": "/events/",
"@type": "Collection",
"member": [ ... ],
...
"operation": {
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
}
{
"@id": "Event",
"@type": "Class",
"supportedProperty": {
"property": "name",
"required": true
}
}
http://example.com/events/
{
"@id": "/events/",
"@type": "Collection",
"member": [ ... ],
...
"operation": {
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
}
{
"@id": "Event",
"@type": "Class",
"supportedProperty": {
"property": "name",
"required": true
}
}
http://example.com/events/oregon/
{
"@id": "/events/oregon/",
"@type": "Collection",
"member": [ ... ],
...
"operation": {
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
}
http://example.com/events/oregon/
{
"@id": "/events/oregon/",
"@type": "Collection",
"member": [ ... ],
...
}
{
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
{
"@id": "EventCollection",
"@type": "Class",
"subClassOf": "Collection",
"supportedOperation": {
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
}
http://example.com/events/oregon/
{
"@id": "/events/oregon/",
"@type": "EventCollection",
"member": [ ... ],
...
}
{
"@type": "AddAction",
"method": "POST",
"expects": "Event"
}
/**
* Event
*
* @HydraExpose(iri="http://schema.org/Event")
* @HydraId("event_retrieve")
* @HydraOperations( {
* "event_replace",
* "event_delete"
* } )
*/
class Event
{
/**
* The event's name
*
* @HydraExpose(iri="http://schema.org/name", required=true)
*/
private $name;
// ... other members and methods ...
}
$ php app/console hydra:generate:crud 
--entity=MLEventApiBundle:Event 
--route-prefix=/events/ 
--with-write 
--no-interaction
CRUD generation
Generating the CRUD code: OK
You can now start using the generated code!
/**
* Event controller
*
* @Route("/events")
*/
class EventController extends HydraController
{
/**
* Creates a new Event entity
*
* @Route("/", name="event_create")
* @Method("POST")
*
* @HydraOperation(
* type = "http://schema.org/AddAction",
* expect = "MLEventApiBundleEntityEvent"
* })
*
* @return MLEventApiBundleEntityEvent
*/
public function collectionPostAction(Request $request)
{
...
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze
Creating Awesome Web APIs is a Breeze

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
 
Understanding DLmalloc
Understanding DLmallocUnderstanding DLmalloc
Understanding DLmalloc
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
 
Neo4j: Import and Data Modelling
Neo4j: Import and Data ModellingNeo4j: Import and Data Modelling
Neo4j: Import and Data Modelling
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
JSON-LD for RESTful services
JSON-LD for RESTful servicesJSON-LD for RESTful services
JSON-LD for RESTful services
 
JDBC
JDBCJDBC
JDBC
 
JSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social WebJSON-LD: JSON for the Social Web
JSON-LD: JSON for the Social Web
 
Grails transactions
Grails   transactionsGrails   transactions
Grails transactions
 
Flask Basics
Flask BasicsFlask Basics
Flask Basics
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
 
Java reflection
Java reflectionJava reflection
Java reflection
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Php
PhpPhp
Php
 
Poly
PolyPoly
Poly
 
[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their Accessing[OOP - Lec 09,10,11] Class Members & their Accessing
[OOP - Lec 09,10,11] Class Members & their Accessing
 
Javapolymorphism
JavapolymorphismJavapolymorphism
Javapolymorphism
 
Polymorphisme, interface et classe abstraite
Polymorphisme, interface et classe abstraitePolymorphisme, interface et classe abstraite
Polymorphisme, interface et classe abstraite
 

Andere mochten auch

Evaluación de la Educación en Ciudad de Bs As: por la mala senda
Evaluación de la Educación en Ciudad de Bs As:  por la mala sendaEvaluación de la Educación en Ciudad de Bs As:  por la mala senda
Evaluación de la Educación en Ciudad de Bs As: por la mala senda
Laura Marrone
 

Andere mochten auch (18)

Why and How to Optimize Your Data Architecture for an Integrated Future
Why and How to Optimize Your Data Architecture for an Integrated FutureWhy and How to Optimize Your Data Architecture for an Integrated Future
Why and How to Optimize Your Data Architecture for an Integrated Future
 
The Web Is Changing — From Strings to Things
The Web Is Changing — From Strings to ThingsThe Web Is Changing — From Strings to Things
The Web Is Changing — From Strings to Things
 
A Deep Dive into JSON-LD and Hydra
A Deep Dive into JSON-LD and HydraA Deep Dive into JSON-LD and Hydra
A Deep Dive into JSON-LD and Hydra
 
Hypermedia Cannot be the Engine
Hypermedia Cannot be the EngineHypermedia Cannot be the Engine
Hypermedia Cannot be the Engine
 
The Web 3.0 is just around the corner. Be prepared!
The Web 3.0 is just around the corner. Be prepared!The Web 3.0 is just around the corner. Be prepared!
The Web 3.0 is just around the corner. Be prepared!
 
Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)
 
Model Your Application Domain, Not Your JSON Structures
Model Your Application Domain, Not Your JSON StructuresModel Your Application Domain, Not Your JSON Structures
Model Your Application Domain, Not Your JSON Structures
 
Presentation For Arin6912
Presentation For Arin6912Presentation For Arin6912
Presentation For Arin6912
 
SOCIAL MEDIA PRESENTATION: Staff Relations - Raising our Collective Understan...
SOCIAL MEDIA PRESENTATION: Staff Relations - Raising our Collective Understan...SOCIAL MEDIA PRESENTATION: Staff Relations - Raising our Collective Understan...
SOCIAL MEDIA PRESENTATION: Staff Relations - Raising our Collective Understan...
 
SharePoint 2016 Up Close and Personal
SharePoint 2016   Up Close and PersonalSharePoint 2016   Up Close and Personal
SharePoint 2016 Up Close and Personal
 
Good governance for new bank products
Good governance for new bank productsGood governance for new bank products
Good governance for new bank products
 
Evaluación de la Educación en Ciudad de Bs As: por la mala senda
Evaluación de la Educación en Ciudad de Bs As:  por la mala sendaEvaluación de la Educación en Ciudad de Bs As:  por la mala senda
Evaluación de la Educación en Ciudad de Bs As: por la mala senda
 
ренейм пптха
ренейм пптхаренейм пптха
ренейм пптха
 
Weekly plannig6 2012
Weekly plannig6 2012Weekly plannig6 2012
Weekly plannig6 2012
 
Построение гиперболического параболоида
Построение гиперболического параболоидаПостроение гиперболического параболоида
Построение гиперболического параболоида
 
GPS the Path to Student Success - SmarterMeasure Best Practices
GPS the Path to Student Success - SmarterMeasure Best PracticesGPS the Path to Student Success - SmarterMeasure Best Practices
GPS the Path to Student Success - SmarterMeasure Best Practices
 
DBW 7x20x21 - Dean Johnson, Brandwidth
DBW 7x20x21 - Dean Johnson, BrandwidthDBW 7x20x21 - Dean Johnson, Brandwidth
DBW 7x20x21 - Dean Johnson, Brandwidth
 
How to get Executive Buy-in for Employee Recognition
How to get Executive Buy-in for Employee RecognitionHow to get Executive Buy-in for Employee Recognition
How to get Executive Buy-in for Employee Recognition
 

Mehr von Markus Lanthaler

Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Markus Lanthaler
 

Mehr von Markus Lanthaler (10)

From Strings to Things to a Web of Services
From Strings to Things to a Web of ServicesFrom Strings to Things to a Web of Services
From Strings to Things to a Web of Services
 
Full-on Hypermedia APIs with Hydra
Full-on Hypermedia APIs with HydraFull-on Hypermedia APIs with Hydra
Full-on Hypermedia APIs with Hydra
 
Creating 3rd Generation Web APIs with Hydra
Creating 3rd Generation Web APIs with HydraCreating 3rd Generation Web APIs with Hydra
Creating 3rd Generation Web APIs with Hydra
 
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
 
A Web of Things to Reduce Energy Wastage
A Web of Things to Reduce Energy WastageA Web of Things to Reduce Energy Wastage
A Web of Things to Reduce Energy Wastage
 
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
Aligning Web Services with the Semantic Web to Create a Global Read-Write Gra...
 
SAPS - Semantic AtomPub-based Services
SAPS - Semantic AtomPub-based ServicesSAPS - Semantic AtomPub-based Services
SAPS - Semantic AtomPub-based Services
 
A Semantic Description Language for RESTful Data Services to Combat Semaphobia
A Semantic Description Language for RESTful Data Services to Combat SemaphobiaA Semantic Description Language for RESTful Data Services to Combat Semaphobia
A Semantic Description Language for RESTful Data Services to Combat Semaphobia
 
Semantic Web Services: State of the Art
Semantic Web Services: State of the ArtSemantic Web Services: State of the Art
Semantic Web Services: State of the Art
 
Towards a RESTful Service Ecosystem
Towards a RESTful Service EcosystemTowards a RESTful Service Ecosystem
Towards a RESTful Service Ecosystem
 

Kürzlich hochgeladen

ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
Madan Karki
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
Sampad Kar
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
Kamal Acharya
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Lovely Professional University
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
MaherOthman7
 

Kürzlich hochgeladen (20)

ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and Applications
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdf
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
Artificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian ReasoningArtificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian Reasoning
 
Online book store management system project.pdf
Online book store management system project.pdfOnline book store management system project.pdf
Online book store management system project.pdf
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 

Creating Awesome Web APIs is a Breeze