Exchanging interoperable representations via profiles
Ruben Verborgh
Ghent University – imec
Could I have your dataset?
Sure, in what format?
XML is fine!
Yeah, but… what kind of XML?
Creating more specific content types
simply does not scale.
text/vnd.council.decision+turtle
application/vnd.council.decision+ld+json
application/vnd.foaf.person+ld+json
application/vnd.council.decision.foaf.person+ld+json
- …
A profile is an independently combinable
set of structural and semantic constraints.
- https://example.org/profiles/council-decision
- https://example.org/profiles/person-foaf
- https://example.org/profiles/person-schema-org
-
https://schema.org/
- https://schema.org/docs/jsonldcontext.jsonld
- …
Our aim is to expose data
in a sustainable way.
- backward compatibility
- Applications using today’s entry points
should work in the future.
- forward compatibility
- Entry points of the future
should not break today’s applications.
Every exposed resource should have
a representation-independent URL.
- mandatory: URL for the resource
https://council.my/decisions/3147
- optional: URLs for representations of the resource
https://council.my/decisions/3147.json
https://council.my/decisions/3147.ttl
https://council.my/decisions/en/3147.xml
- …
Via HTTP content negotiation,
clients send representation preferences.
HTTP request
GET /decisions/3147 HTTP/1.1
Host: council.my
Accept: application/ld+json;q=1.0,text/turtle;q=0.8
Accept-Language: en
…
Via HTTP content negotiation,
servers send a matching representation.
HTTP response
HTTP/1.1 200 OK
Content-Type: application/ld+json
Content-Language: en
…
There are various negotiation dimensions,
but none existed yet for profiles.
- content type
- language
- versions
- …
We designed profile negotiation as part of
the W3C Data Exchange Working Group.
- currently a draft aimed for IETF
-
design decisions
- a profile is identified by a URI
- profiles can work across content types
- representations can conform to multiple profiles
Clients indicate their support
or preference for certain profiles.
HTTP request
GET /decisions/3147 HTTP/1.1
Host: council.my
Accept: application/ld+json;q=1.0,text/turtle;q=0.8
Accept-Profile:
"https://example.org/profiles/council-decision"; q=1.0,
"https://example.org/profiles/person-foaf"; q=0.8,
"https://example.org/profiles/person-schema-org"; q=0.6
…
Servers indicate the profiles
to which the representation conforms.
HTTP response
HTTP/1.1 200 OK
Content-Type: application/ld+json
Content-Language: en
Link: <https://example.org/profiles/council-decision>;
rel="profile",
<https://example.org/profiles/person-schema-org>;
rel="profile"
…
Learn more about negotiation by profile
at the following places.