Skip to content

instead of X- headers, use link relations/linked data #3

Description

@daxim

X- headers are the wrong solution to this kind of problem. They are not interoperable in the sense that you do not get to authoritatively define the semantics. Instead you need to convince the rest of the whole world to join your private club of X-Human-* implementors, which is unlikely to happen.

Here's how you do it properly on the Web. Relations between entities are expressed by typed hyperlinks. Entities are addressed with URIs. The type of the hyperlink is an IANA registered string or a URI. Link relations can be expressed in hypertext documents (e.g. a, link, area elements with rel attribute in HTML; XLink in XML; _links property in HAL+JSON) or as an RFC 5988 HTTP Link header.

Example: you have just made http://example.net/something and want to express this. Add the HTTP headers

Link: <mailto:david@randomdrake.com>; rel="author"
Link: <http://randomdrake.com/hello-there/#me>; rel="author"

If "something" happens to be a hypertext document (here, HTML), you can also inline links:

<head>
    <link href="mailto:david@randomdrake.com" rel="author" />
    <link href="http://randomdrake.com/hello-there/#me" rel="author" />

or perhaps

<footer>
    <p>Made with lots of love by <address>
        <a href="http://randomdrake.com/hello-there/#me" rel="author">
            randomdrake
        </a></address>.
    </p>

Dereferencing that second hyperlink returns some semantically rich hypertext document, e.g. HTML5 with RDFa lite:

<section vocab="http://schema.org/" typeof="Person">
    My name is <span property="name">David Drake</span>
    and for purposes of illustration only, claim to
    <a property="worksFor" href="http://example.com/">
    work for <span typeof="Corporation" property="name">
    Acme Widgets, Inc.</span></a>.
    ⋮
    <ul id="social-links" property="account">
        <li vocab="http://rdfs.org/sioc/ns#" typeof="UserAccount"><a href="https://twitter.com/randomdrake" title="Follow Me on Twitter">
            <i class="icon-twitter"><span property="accountName">@randomdrake</span></i>
        </a></li>
        <li vocab="http://rdfs.org/sioc/ns#" typeof="UserAccount"><a href="https://github.com/randomdrake" title="Check Out My Github">
            <i class="icon-github"><span property="accountName">randomdrake</span></i>
        </a></li>
    </ul>

That's the idea of linked data. At Acme's homepage, they might express their intent with e.g.

<a rel="http://nazou.fiit.stuba.sk/nazou/ontologies/v0.6.17/offer-job"
    href="http://example.com/hiring">We're hiring!</a>

As you see, the semantics of those four pieces metadata in your proposal are already expressed in existing vocabularies, backed by numerous solid Internet and Web standards and there's already a huge ecosystem of readily working software that can process these data. I think X-Human-* should be killed off in favour of the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions