Re: [manifest] A way to link to related applications (#326)

OK, I've been racking my brains for a way that this could be done in a way that doesn't really suck. First I started with a vendor prefix for each vendor:

```
"android_alternate": {
   "href": "https://play.google.com/store/apps/details?id=com.facebook.katana"
},
"apple_alternate": {
    "href": "https://itunes.apple.com/gb/app/facebook/id284882215"
},
"ms_alternate": {
  "href":  "http://apps.microsoft.com/windows/en-gb/app/facebook/add3d66a-358d-4fe2-be68-8a3f934e9ea1"
}
```
Because there isn't a standard way to identify non-web apps, each vendor could extend this with whatever metadata they need. But vendor prefixes kind of suck...

Then I thought maybe a URL is sufficient to describe a non-web app by pointing at its app store URL (as has been suggested), and the store and ID could be parsed from the URL. So I started trying to re-invent HTML link relations in JSON, which could be used for lots of things, including pointing to a "related" page on an app store:
```
    "linked_resources": [
      {
        "rel": "alternate",
        "hreflang": "fr",
        "href": "http://facebook.fr/manifest.json"
      },
      {
        "rel": "describedBy",
        "href": "https://marketplace.firefox.com/app/facebook-1"
      },
      {
        "rel": "related",
        "href": "https://play.google.com/store/apps/details?id=com.facebook.katana"
      }
    ]
```
But, well that adds a lot of cruft to the manifest specification and is a bit over-engineered.

So then I sat scratching my metaphorical beard. If only there was a standard way to mark up linked data about a software application in JSON, which is suitable for user agents and search engines to parse, and which wouldn't require us to fill the "Manifest for web application" specification with data about something which isn't a web application.

Then I realised, there is! Ladies and gentlemen, I present the SoftwareApplication schema from schema.org [1].

This is a schema to mark up linked data about a software application, can be encoded in JSON in a W3C recommended way using JSON-LD [2], was designed specifically for search engines/user agents to parse, and Google even helped define it!

A simple example might be:

```
"linked_data": [
  {
    "@context": "http://schema.org",
    "@type": "SoftwareApplication",
    "operatingSystem": "Android 3.0",
    "installUrl": "https://play.google.com/store/apps/details?id=com.facebook.katana",
  }
]
```

but the schema includes many more properties if the vendor needs them.

The beauty of this solution is that all the manifest specification needs is a hook to define any type of linked data related to the web application (there was actually previously text in the spec which mentioned JSON-LD as an extension mechanism), and the rest can be documented elsewhere. For example, Google, Apple or Microsoft's developer documentation can describe how to mark up a software application for their platforms in JSON-LD, such that search engines and user agents can parse it from the manifest.

What do you think?

1. https://schema.org/SoftwareApplication
2. http://www.w3.org/TR/json-ld/

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/326#issuecomment-85946714

Received on Wednesday, 25 March 2015 09:16:07 UTC