Github adds JSON-LD support in core product

Github has just announced that they’ve added JSON-LD and schema.org support. Now if you get a pull request via email, and your mail client supports it (like Gmail does), you’ll see an action button shown in the display without having to open the email, like so:

How does Github do this? With schema.org Actions, which use JSON-LD markup. When you get an email from Github, it will now include markup that looks like this:

<script type="application/ld+json">
{
  "@context":"http://schema.org",
  "@type": "EmailMessage",
  "description": "View this Pull Request on GitHub",
  "action": {
    "@type": "ViewAction",
    "url":"https://github.com/perma-id/w3id.org/pull/47",
    "name":"View Pull Request"
  }
}
</script>

Programs like Gmail then take that JSON-LD and translate it into a simple action that you can take without opening the email. Do you send emails to your customers, if so, Meldium has a great HOW-TO on integrating schema.org actions with your customer emails.

Hooray for Github, schema.org, and JSON-LD!

4 Comments

Got something to say? Feel free, I want to hear from you! Leave a Comment

  1. shouldn’t they use
    Thing –{potentialAction}–> Action
    Action –{target}–> EntryPoint

    {
    “@context”:”http://schema.org”,
    “@type”: “EmailMessage”,
    “description”: “View this Pull Request on GitHub”,
    “potentialAction”: {
    “@type”: “ViewAction”,
    “result”:”https://github.com/perma-id/w3id.org/pull/47″,
    “name”:”View Pull Request”
    }
    }

    also wouldn’t the WebPage or gh:Issue would have potentialAction, not EmailMessage ?

    http://schema.org/docs/actions.html
    Part 3: Action EntryPoints
    {
    “@context”: “http://schema.org”,
    “@type”: “Movie”,
    “name”: “Footloose”,
    “potentialAction” : {
    “@type”: “WatchAction”,
    “target” : “http://example.com/player?id=123″
    }
    }

  2. Seems that they’ve switched from JSON-LD to Microdata, which is a bit disappointing. I wonder why they did it.

Leave a Comment

Let us know your thoughts on this post but remember to play nicely folks!