jf2

From IndieWeb
jf2 icon
jf2 icon


jf2 is a W3C Note and a JSON Post Serialization Format of microformats2 for that is optimized for h-entry consuming code, as compared to the standard microformats JSON representation.

Status
This is a living Editor's Draft yet mature enough to encourage implementations and feedback.
Editor's Draft
https://jf2.spec.indieweb.org/
W3C Note
https://www.w3.org/TR/jf2/
Participate
Wiki (Feedback, Open issues, issues on GitHub)
IRC: discussion on #indieweb-dev #indieweb-dev on Libera
Editors
Kevin Marks
Benjamin Roberts

jf2 was published by the W3C Social Web Working Group as a W3C Note on 2018-01-10, and is currently maintained by the IndieWeb community as a Living Standard at https://jf2.spec.indieweb.org/

Use cases

Common data structure for Microsub servers

The Microsub-spec draft standard specifies jf2 as the format in which objects should be stored. Servers who aim to comply with the standard must store objects in jf2. Clients must interpret jf2 objects to render content from feeds polled by the server.

Personal website feed

Some IndieWeb community members publish jf2 feeds directly to their websites.

Add more

Have a use case for jf2? Add it here.

Example

{
  "type":"entry",
  "author":{
    "type":"card",
    "name":"Kevin Marks",
    "photo":"http://known.kevinmarks.com/file/9255656669173b7867ab839ee6556f9e",
    "url":"http://known.kevinmarks.com/profile/kevinmarks"
  },
  "url":"http://known.kevinmarks.com/2015/i-was-just-listening-to-programmesp02xy80y-about-how-we-reconstruct",
  "published":"2015-07-30T00:32:47+00:00",
  "content":{
    "text":"I was just listening to http://www.bbc.co.uk/programmes/p02xy80y about how we reconstruct memories continuously, and they can be changed by other people gaslighting us. Once silos learn to do this your written records will be even more precious.",
    "html":"<p>I was just listening to <a href=\"http://www.bbc.co.uk/programmes/p02xy80y\" rel=\"nofollow\">http://www.bbc.co.uk/programmes/p02xy80y</a> about how we reconstruct memories continuously, and they can be changed by other people gaslighting us. Once silos learn to do this your written records will be even more precious.</p>\n "
  },
  "in-reply-to": [
      "http://rhiaro.co.uk/2015/07/digital-memories"
  ],
  "wm-property":"in-reply-to"
}

This example of jf2 contains an additional "wm-property" value that indicates the property that contains the primary relation of the webmention. In the example above, this is the "in-reply-to" property, but may also be the "like-of" or "repost-of" property.

IndieWeb Examples

Aaron Parecki

Aaron Parecki publishes a jf2 feed of his home page and other top-level feeds since 2017-11-25. The jf2 feed is generated by running the HTML of the generated page through XRay to output the jf2 format.

Grant Richmond

Grant Richmond is creating a collection of jf2 format post examples at https://grantcodes.github.io/jf2-examples/

Kaushal Modi

Kaushal Modi publishes jf2 feeds of his home page and other top-level feeds since 2018-04. The jf2 feed is generated using Hugo (Template for generating the jf2 feed). Similarly jf2 posts are also generated for each post (Template for generating the jf2 post).

Jason Garber

Jason Garber publishes jf2 sidefiles of content types using FrancisCMS on his personal website, https://sixtwothree.org.

Implementations

webmention.io

webmention.io can return a list of mentions of a URL in jf2 format. For example, https://webmention.io/api/mentions.jf2?target=http://rhiaro.co.uk/2015/07/digital-memories

XRay

XRay parses a number of different formats into a normalized jf2 format. For example:

socialstreams

Ben Roberts has set up a stream service at http://stream.thatmustbe.us that can convert MF2 to JF2 and back again. Code can be found on GitHub

Post Kinds for WordPress

David Shanske began converting his parsing code within the Post Kinds plugin to returnn jf2 and will likely be reimplementing additional code within same to use a mix of jf2 and mf2 as a way of ensuring better consistency and cross-compatibility. This is a work in progress.

IndieWeb Search

IndieWeb Search offers a jf2 feed for all search results. Visitors can subscribe to this feed in any feed reader that parsers jf2. Visitors can also parse this feed to derive insights from search results or watch for search rank changes.

capjamesg

capjamesg offers jf2 feeds for his posts, notes, likes, and bookmarks on his personal website:

James has also implemented logic that converts XML (RSS/Atom), JSON Feed, and h-feeds to jf2 as part of his Microsub reader. This logic is available in files in the following folder on GitHub:

https://github.com/capjamesg/microsub/tree/main/feeds

more implementations

See Also