Linked Data Notifications

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Linked Data Notifications
StatusW3C Recommendation
First published2017-05-02
OrganizationWorld Wide Web Consortium
EditorsSarven Capadisli, Amy Guy
Base standardsHTTP, URI, RDF, JSON-LD
Related standardsLinked Data Platform, RDFa, Turtle
DomainSemantic Web, Communications protocol
AbbreviationLDN
Websitewww.w3.org/TR/ldn/

Linked Data Notifications (LDN) [1] is a W3C Recommendation that describes a communications protocol based on HTTP, URI, and RDF on how servers (receivers) can receive messages pushed to them by applications (senders), as well as how other applications (consumers) may retrieve those messages. Any web resource (like a HTML page) can advertise a receiving endpoint (inbox) for notification messages. Messages are expressed in RDF, and can contain arbitrary data.

Motivation[edit]

The web is a decentralized system of web resources, published by multiple organizations and individuals. Web resources, such as web pages and more formally structured Linked Data, frequently include links to other resources across the web, and may comment or describe them in various ways. The receiving end, however, are not generally notified of such link creation, and thus are unable to provide backlinks without manual intervention. Interactions within social media platforms, such as comments on a news article, are currently "locked" within the platform and hard to access across the web.

Several linkback mechanisms exists, and are commonly used between blog systems, e.g. a "response" post in blog B about a post in blog A causes B's platform to send a pingback to be shown on the original blog A. These mechanisms are however generally limited in which structured information can be sent, and the notifications themselves do not form part of the decentralized web and may be difficult to consume by any third party application.

A key motivation for LDN is to support notifications between decentralized Web applications [2], including web browsers who - not having their own HTTP server - are unable to generate a HTTP link for their reply messages. Another motivation is to structure notifications as RDF statements using any Controlled vocabulary - so that any consuming application can select the particular information they understand.

Protocol[edit]

  • A sender or receiver performs a GET or HEAD to an existing HTTP resource. Its inbox URI is discovered from either:
    • A Link: relation in the HTTP response headers of type http://www.w3.org/ns/ldp#inbox
    • An RDF statement embedded in the HTTP body using the RDF property http://www.w3.org/ns/ldp#inbox
  • A sender creates a new notification (e.g. as JSON-LD), which it POSTs to the inbox URI.
    • The receiver creates a new HTTP resource containing the posted notification and responds with 201 Created and the created URI.
  • A consumer retrieves RDF from the discovered inbox URI using GET, then:
    • The consumer parses the response body to find RDF statements with the property http://www.w3.org/ns/ldp#contains. The object of these statements give the URIs to the accepted LDN notifications.
    • The consumer retrieve any of the linked notification using GET and process their RDF in an application-specific manner.
    • Notifications remain accessible, and can therefore be linked to and described in other web resources.

At each stage, the sender and consumer may perform content negotiation to send or receive in any mutually agreed RDF serialization format, however a compliant LDN receiver must support at least JSON-LD.

Examples[edit]

A sender or consumer discovers the inbox for a given URI, in this example using the HEAD method:

HEAD http://example.org/article/5 HTTP/1.1
HTTP/1.1 200 OK
Link: <http://example.org/inbox/7>; rel="http://www.w3.org/ns/ldp#inbox"

A sender sends a notification to the discovered inbox, in this example using the Schema.org vocabulary:

POST http://example.org/inbox/7 HTTP/1.1
Content-Type: application/ld+json

{ "@context": "http://schema.org",
  "@type": "ReviewAction",
  "object" : {
    "@id": "http://example.org/article/5"
  },
  "agent": { 
    "@type": "Person",
    "name": "Alice" 
  },
  "result": {
    "@type": "Review",
    "reviewBody": "This article is the best I've ever seen!"
  }
}
HTTP/1.1 201 Created
Location: http://example.org/inbox/f44f3f11

A consumer lists the content of the discovered inbox to find 3 notifications:

GET http://example.org/inbox/7 HTTP/1.1
Content-Type: application/ld+json
HTTP/1.1 200 OK
Content-Type: application/ld+json

{
  "@context": "http://www.w3.org/ns/ldp",
  "@id": "http://example.org/inbox/7",
  "contains": [
    "http://example.org/inbox/5c6ca040",
    "http://cdn.example.org/inbox/92d72f00",
    "http://example.org/inbox/f44f3f11",
  ]
}

Note that the URIs of the original resource, inbox and notifications are not required to be hosted on the same HTTP server (e.g. they may be on a CDN). The consumer follows the links for any notifications they wish to retrieve.

In this example, the consumer retrieves the new f44f3f11 notification, with content negotiation to prefer the Turtle RDF format:

GET http://example.org/inbox/f44f3f11 HTTP/1.1
Accept: application/ld+json;q=0.9, text/turtle;q=1.5
HTTP/1.1 200 OK
Content-Type: text/turtle 

@prefix schema: <http://schema.org/> .
 [   a schema:ReviewAction;
     schema:agent [
       a schema:Person;
       schema:name "Alice"
     ];
     schema:object <http://example.org/article/5>;
     schema:result [
       a schema:Review;
       schema:reviewBody "This article is the best I've ever seen!"
     ]
 ] .

Implementations[edit]

Several LDN implementations exists[2][3], covering senders, consumers and receivers, including:

Any Linked Data Platform (LDP) implementations are also conforming Linked Data Notification receivers as LDN is a strict subset of LDP.[2]

References[edit]

  1. ^ Capadisli, Sarven; Guy, Amy, eds. (2017-05-02). "Linked Data Notifications". W3C Recommendation. https://www.w3.org/TR/ldn/.
  2. ^ a b c Capadisli, Sarven; Guy, Amy; Lange, Christoph; Auer, Sören; Sambra, Andrei; Berners-Lee, Tim (2017-05-28). "Linked Data Notifications: A Resource-Centric Communication Protocol". The Semantic Web. ESWC 2017. Lecture Notes in Computer Science. Springer, Cham. 10249: 537–553. doi:10.1007/978-3-319-58068-5_33. http://csarven.ca/linked-data-notifications.
  3. ^ "LDN Test Reports and Summary". linkedresearch.org. Retrieved 2017-05-26.