This is a multi-stage proposal for supporting documents in Streams.  Activity Streams 2.0 explicitly supports types as first class citizens.  While Apache Streams supports only Activity Streams 1.0 as of this writing, using will be an incentive to adopt AS 2.0 and preparation for that support can begin prior to full AS 2.0 support. 


A developer building with streams should be able to:

  1. Instantiate and then modify POJOs for core [1]
  2. Assign them to the actor, provider, object, and target fields of an activity
  3. Expect proper serialization and deserialization of application/json type documents
  4. Implement a conversion between an activity streams object and a object


Phase 1: model core objects using json-schema in a new project module.  generate and publish POJOs in maven artifacts

Phase 2: implement unit tests that demonstrate proper serialization and deserialization of json-formatted documents

Phase 3: provide a way to swap ActivityObject and Thing java classes in an intelligent way, and for management of activities with any class that extends Thing assignable to any field that currently requires an ActivityObject

Phase 4: support serialization to and from JSON-LD

Phase X: implement the extended vocabularies as well


  • streams-plugin-pojo does not currently support the jsonschema oneOf or anyOf syntax introduced with jsonschema v4. some fields can one one of several possible types.  we'll have to figure out a way to deal with this challenge at each phase
  • DateTimes - specifies datetimes using ISO 8601 whereas activity streams uses RFC3339.
  • Other libraries - we should be able to demonstrate compatibility with google's schemaorg-java library.  This will probably require adding optional GSON support to streams-pojo and streams-plugin-pojo.