Functional Descriptions as the Bridge between Hypermedia APIs

advertisement
ELIS – Multimedia Lab
Functional Descriptions as the Bridge between
Hypermedia APIs and the Semantic Web
Ruben Verborgh · Thomas Steiner · Davy Van Deursen
Sam Coppens · Joaquim Gabarro · Rik Van de Walle
Is following
your nose
sufficient?
How I got to Lyon.
Lille
REIMS
Dijon
Lyon
Did I really follow my nose?
What would have happened
if I had actually followed my nose.
If I had followed my nose,
it would have taken forever
to find the sign that says
Lyon
Signs everywhere,
but which should my nose follow?
Brussels
Eindhoven
Vienna
Munich
Following my nose was easy,
because I knew what to look for.
Lille
REIMS
Dijon
Lyon
As a human,
you can follow your nose
because you know how to.
You always have some plan,
and use your nose
to find the next step.
RESTdesc
tells machines
how to follow their nose.
It allows them
to create a plan
so they can find the next step.
ELIS – Multimedia Lab
RESTdesc describes
the functionality of hypermedia APIs.
Why? – need and challenges
What? – syntax and structure
So what? – benefits and potential
ELIS – Multimedia Lab
This hypermedia API
creates a thumbnail of a photograph.
Send a photo,
photo retrieve its thumbnail.
ELIS – Multimedia Lab
API description methods
already exist.
There are 10+ ways to describe that
the input is an image
and the output is an image.
This doesn’t tell machines
what the API does.
ELIS – Multimedia Lab
API description methods
already exist.
There are 10+ ways to describe that
the input is a photo
and the output is a thumbnail.
This doesn’t tell machines
what the API does.
ELIS – Multimedia Lab
The functional relationship
is missing.
What thumbnail?
ELIS – Multimedia Lab
Only the functional relationship
tells the full story.
What thumbnail?
Send a photo, retrieve its thumbnail.
ELIS – Multimedia Lab
RESTdesc describes
the functionality of hypermedia APIs.
Why? – need and challenges
What? – syntax and structure
So what? – benefits and potential
ELIS – Multimedia Lab
RESTdesc expresses functionality
in a Semantic Web language.
HTTP
resources and hypermedia links
Notation3
small superset of RDF
Your own vocabulary
ELIS – Multimedia Lab
RESTdesc expresses functionality
in a Semantic Web language.
HTTP
resources and hypermedia links
Notation3
small superset of RDF
Your own vocabulary
ELIS – Multimedia Lab
RDF expresses everything
in three parts.
!
!"#$%&'&(!)*+,(!$%&'&-""
!!!!!!!!!!!!!!!!!!!!!!!!
!
subject
verb
object
!!
ELIS – Multimedia Lab
Namespaces create
universal meaning.
#$%&'()!!!*+,,$-..&)/0$1&"2%3.$+2,2.4"!
#$%&'()!./0!!*+,,$-..555"56"2%3.7888.9:.::;%<';=>?,/);?=@4"
#$%&'()!/123/),!!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
-D>E+2,2!./0!,>$&!/123/),!E+2,2"""
!!!!!!!!!!!!!!!!!!!!!!!!
!
namespaces
!!
ELIS – Multimedia Lab
Notation3 variables allow
generalized expressions.
#$%&'()!-!*+,,$-..&)/0$1&"2%3.$+2,2.4"!
#$%&'()!%<'-!*+,,$-..555"56"2%3.7888.9:.::;%<';=>?,/);?=@4"
#$%&'()!<A$&<(/-!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
452%&'&!%<'-,>$&!<A$&<(/-E+2,2"6
!!!!!!!!!!!!!!!!!!!!!!!!
!
variables
!!
ELIS – Multimedia Lab
Implications quantify
and connect variables.
#$%&'()!-!*+,,$-..&)/0$1&"2%3.$+2,2.4"!
#$%&'()!%<'-!*+,,$-..555"56"2%3.7888.9:.::;%<';=>?,/);?=@4"
#$%&'()!<A$&<(/-!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
FG$+2,2!%<'-,>$&!<A$&<(/-E+2,2"H
78!!!!!!!!!!!!!!!!!!!!!!!
!
!!FG$+2,2!%<'-,>$&!<A$&<(/-I0/3&"H"
implications (if – then)
ELIS – Multimedia Lab
We want to explain the functionality
of the thumbnail API to machines.
rel = "smallThumbnail"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
#$%&'()!&)-!*+,,$-..&)/0$1&"2%3.(0/3&@4"
#$%&'()!+,,$-!*+,,$-..555"56"2%3.:977.+,,$@4"
#$%&'()!<A$&<(/-!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
#$%&'()!<A$&<(/;251-!*+,,$-..<A$&<(/"2%3.2?,2123>.4"
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
rel = "smallThumbnail"
IF
F
!!G$+2,2!39!*:,;;<%=:1>,);!G%&=2B%C&"
H
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
rel = "smallThumbnail"
THEN
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
78
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
rel = "smallThumbnail"
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
K4
F
((+!.3?=3*'(%''2!:3'%&/@,:3(ABC<AD
((((((((((((%''2!.3?=3*'EFG(5.3*&=.H3D
((((((((((((%''2!.3*2(I(%''2!1&/#(5.3*&=.H3(J!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
rel = "smallThumbnail"
F
!!52%&'&!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
Send a photo, retrieve its
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!52%&'&!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
thumbnail.
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
rel = "smallThumbnail"
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
((5.3*&=.H3(,(/123/),!G:,K3D
((((((((((((/123/),L&M;!%3)K%'(NO-OH"
ELIS – Multimedia Lab
RESTdesc tells the full story
with the functional relationship.
#$%&'()!&)-!*+,,$-..&)/0$1&"2%3.(0/3&@4"
#$%&'()!+,,$-!*+,,$-..555"56"2%3.:977.+,,$@4"
#$%&'()!<A$&<(/-!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
#$%&'()!<A$&<(/;251-!*+,,$-..<A$&<(/"2%3.2?,2123>.4"
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
State-changing operations
are supported, too.
GET, HEAD
dereferencing
PUT, PATCH, DELETE
fully defined
POST
resource-specific state changes
ELIS – Multimedia Lab
Add a comment
to this photograph.
#$%&'()!&)-!*+,,$-..&)/0$1&"2%3.(0/3&@4"
#$%&'()!=(2C-!*+,,$-..%<'="2%3.=(2C.?=@4"
#$%&'()!+,,$-!*+,,$-..555"56"2%3.:977.+,,$@4"
F
!!52%&'&!&)-C200&?,=!GC200&?,="
!!GC200&?,!=(2C-C2?,&?,!GC200&?,J&),"
H
Add a comment to
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!O$PQ<OR
!!!!!!!!!!!!+,,$-%&MB&=,STI!GC200&?,=R
!!!!!!!!!!!!+,,$-A2<>!GC200&?,"
!!52%&'&(*)&H!%,*+.32;#(5H&::3>'!!GC200&?,=!&)-C2?,/(?=!GC200&?,"
H"
this photograph.
ELIS – Multimedia Lab
RESTdesc describes
the functionality of hypermedia APIs.
Why? – need and challenges
What? – syntax and structure
So what? – benefits and potential
ELIS – Multimedia Lab
RESTdesc descriptions
are generic.
#$%&'()!&)-!*+,,$-..&)/0$1&"2%3.(0/3&@4"
#$%&'()!+,,$-!*+,,$-..555"56"2%3.:977.+,,$@4"
#$%&'()!<A$&<(/-!*+,,$-..<A$&<(/"2%3.%&=2B%C&.4"
#$%&'()!<A$&<(/;251-!*+,,$-..<A$&<(/"2%3.2?,2123>.4"
F
!!G$+2,2!&)-=0/11J+B0A?/(1!G%&=2B%C&"
H
K4
F
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!G%&=2B%C&R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!G%&=2B%C&!V"
!!G$+2,2!<A$&<(/;251-,+B0A?/(1!G%&=2B%C&"
!!G%&=2B%C&!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
H"
ELIS – Multimedia Lab
Existing Semantic Web tools
can instantiate RESTdesc descriptions.
rel = "smallThumbnail"
R):KRS
R):KRSR'%=:1
!!L-%&MB&=,!+,,$-0&,+2<N/0&!OPQJOR
!!!!!!!!!!!!+,,$-%&MB&=,STI!*.(03.6.,+B0A4R
!!!!!!!!!!!!+,,$-%&=$!U!+,,$-A2<>!*.(03.6.,+B0A4!V"
!!*.(03.64!<A$&<(/;251-,+B0A?/(1!*.(03.6.,+B0A4"
!!*.(03.6.,+B0A4!/!<A$&<(/-I0/3&R
!!!!!!!!!!!!!!!!<A$&<(/;251-+&(3+,!W9"9"
ELIS – Multimedia Lab
Existing Semantic Web tools
can compose RESTdesc descriptions.
R):KRSR'%=:1
local image
R):KRS
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Sed vel lectus quis purus lobortis auctor.
Donec vestibulum gravida eros quis gravida. Duis
interdum posuere quam, sed rhoncus velit
scelerisque in. Aenean vitae eros nec ipsum
venenatis ullamcorper. Aliquam erat volutpat. In nisi
justo, laoreet eget varius nec, iaculis et purus.
Vivamus bibendum pretium adipiscing.
R):KRSRH&::3>'*RT
ELIS – Multimedia Lab
Functional descriptions as the bridge
between hypermedia and the Semantic Web.
hypermedia API
resource
link
resource
action
Semantic Web
functionality
subject
verb
object
description
Following
your nose
is easy
if you know
how to.
RESTdesc
helps
machines
follow
their nose.
ELIS – Multimedia Lab
RESTdesc semantically describes
the functionality of hypermedia APIs.
Learn more at restdesc.org and
discuss with @RubenVerborgh on Twitter.
Download