Things and happenings: modelling social for the web

The online social world is simultaneously and varyingly a mirror, augmentation, and reduction of our offline social lives. Human behaviours are complex and nuanced and context-dependant, inconsistent, sprinkled across many different media, subject to multiple interpretations.. and all kinds of other words that mean it's difficult to wrangle this space into a coherant or complete data model. But, we (computer scientists, software developers) do it anyway.

For some reason, nobody has come up with a solution that pleases everybody yet.

It seems probable, given the diversity of systems, requirements, desires and general worldviews, nobody ever will. So here I come, blazing in with neither history nor experience, to try to write about how I see things. There's a lot of interesting past work in this space, and a full literature(/mailing list/blog post) review is worth doing. But for now, in the interests of time and sanity, I'm sticking to the current state of things as I understand them. In this post, I look at only two different (but overlapping) models. I also want to emphasise that there can't possibly be a single right way of looking at this space. Such models aren't in conflict (as some may think) but simply different ways of looking at the same thing. Where proponants of one may see shortcomings in the other, the opposite is equally true. People's different experiences and needs have led them a way of looking at things that they find perfectly intuitive. Often, this means alternative perspectives are seen as unintuitive and perhaps even in competition. Of course, there's a fine line between accounting for different perspectives, and losting interoperability entirely.

So, let's take stuff. We start with the idea that there is stuff on the social web that we want to describe. One subset of stuff is people. I'm not thinking about modelling people and relationships here.

Other subsets of stuff, which I want to focus on right now, are things and happenings. I'm deliberately trying to pick silly terminology to keep this abstract. You might also think of things as content, items or objects, and happenings as events, interactions or activities.

The two social data models I've spent the most time thinking about recently are ActivityStreams 2.0 and microformats2 (AS2 and mf2 henceforth) and the relationship between them. To various degrees, I've written about them before.

AS2

ActivityStreams was designed as a model for logging happenings (as opposed to a command language, which in some systems it has been used for). AS2's strength is happenings. A happening is modelled as an Activity, which may have a relation to a thing, aka an Object. (Technically an Activity is a type of Object, as is everything else, Actor, Collection, etc, but what I'm referring to here are generic Objects that don't belong to one of these other special classes). There are more specific types of Activity in the AS1 vocab than there are Objects.

mf2

Microformats was designed for marking up all kinds of web documents, and a subset of mf2 is focusing on social, specifically feeds and blog posts. Most people who work with mf2 find that they can adequately represent anything they need to as a thing. mf2's strength is things. The most common type of thing is an entry (a post), and you're also likely to see feeds and cards (profiles). All things can have relationships with other things. There's no particular language for logging happenings with mf2; the existence of a set of things serves that purpose. And no specific types of thing; rather, types of thing are inferred from the semantics of their properties and relationships with other things.

jf2

Both have JSON representations. This is the default for AS2, but mf2 is embedded in html, which means their JSON representation is generated by a parser. Even though there are a set of parsing rules, output can be complicated and vary depending on the structured of the html being parsed, and I've found myself writing my own 'parsing rules' to extract what I want from parsed mf2. Fortunately Aaron and Ben are working on a vastly simplified JSON representation of mf2, called jf2.

All together now

AS2 is already under the remit of the W3C Social Web WG (edited by James), and at the recent face-to-face, jf2 was (somewhat controversially) accepted as an Editor's Draft for the group as well.

The WG is chartered to produce a 'social syntax'. AS2 works great for those with happenings-centric worldviews, but doesn't always sit right with those who want to focus on things. On that basis, I think the two syntaxes have the potential to complement each other. I don't see why the WG can't produce two syntaxes for these two perspectives, which can be used together in systems which mix and match things and happenings. Not everyone agrees. There are certainly some redundancies and overlaps with both specs in their current state, and thus a lot more work to be done. But the editors are all keen to work together to iron these out, and I'm hopeful that now there's more of a feeling that these specs are complementary rather than competing, working on this will improve both. The strengths of one can plug the weaknesses of the other, and everyone can benefit. We also need to leave room for expansion in the future, as obviously this is anything but a static space.

An addendum for those who are adamantly opposed to one or the other of the models, because the other is obviously right/better: I encourage you to accept that different experiences lead to different conclusions, and if there was an obviously right/better way of doing this we'd have solved it long ago. Bringing together the different experiences of different people in order to benefit everyone is kind of the point of the WG.

These are the two models being considered because their supporters wrote them up as specifications and can demonstrate history and implementation experience. Anyone have a different model of the social world they wish to bring to the table..?

🏷 activitystreams2 as2 phd social web socialwg