Object type of activities

An activity has a property object.
My understanding of the specification is that the property object of the activity must always be of type ActivityStreams 2.0 Terms or a type derived from it.

The following turtle example would be valid:

<http://example.org/test> a <https://www.w3.org/ns/activitystreams#Object>;
  <https://www.w3.org/ns/activitystreams#name> "TestName" .

<http://example.org/testActivity> a <https://www.w3.org/ns/activitystreams#Create>;
  <https://www.w3.org/ns/activitystreams#object> <http://example.org/test> .

However, this turtle example would NOT be allowed:

<http://example.org/test> a <https://schema.org/Organization>;
  <https://schema.org/name> "TestName" .

<http://example.org/testActivity> a <https://www.w3.org/ns/activitystreams#Create>;
  <https://www.w3.org/ns/activitystreams#object> <http://example.org/test> .

I don’t agree that this makes sense, but this is how I interpret the specification. How do you guys see this ?

The spec addresses this here: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object-term. The Range of the property object is Object | Link, so the https://www.w3.org/ns/activitystreams#object link must always point at either an ActivityStreams Object or ActivityStreams Link type. Not sure why this “wouldn’t make sense”—an ActivityStreams processor needs at least some information to be able to work with the object that you give it.

In some senses, the entire purpose of the Object type is to define “This is the class of resources that are able to be used as the object of an activity”

I guess you should ideally specify in the type property the overlap between AS and your custom type, as per the example in Figure 8: An Object that is both a Place and a gr:Location of AS-core spec. I don’t know if that will break interop with other apps that expect a single value for Type.

Just trying to understand this one.

You are saying that a Create verb always takes an Object

But you want to create an Organization. Seems like a reasonable activity to me.

And that the spec says you must create an Object rather than an Organization as type.

Just looking at the wording:


Organization says that it extends Object. I guess in this case Object is like owl : Thing in turtle. Does this solve the issue, ie that Organization extends Object?

You are getting the two different Organization types confused. ActivityStreams https://www.w3.org/ns/activitystreams#Organization != https://schema.org/Organization. The former is an ActivityStreams type and is a sub-type of as:Object, the latter is not.

As @aschrijver mentions and as is mentioned in Example 8 of the ActivityStreams spec, the correct way to specify this is to mark your resource as both as:Organization and schema:Organization

When an implementation uses an extension type that overlaps with a core vocabulary type, the implementation MUST also specify the core vocabulary type. For instance, some vocabularies (e.g. The Good Relations Vocabulary) define their own types for describing locations. An implementation that wishes, for example, to use a GoodRelations Language Reference as an object type MUST also identify the object as being a Place as illustrated in the following:

Certain properties defined by some External Vocabularies can overlap or duplicate those defined by the Activity Vocabulary. Where such overlap exists, for the sake of consistent interoperability, implementations MUST favor the use of properties defined by the Activity Vocabulary.

  "@context": [
      "schema": "http://schema.org#"
  "type": ["Organization", "schema:Organization"],
  "name": "Alice's Restaurant"

I think schema:Organization has much more usage on the web than as:Organization

IMO it’s good to be able to mix and match vocabs

Yes, I posted an example of being able to mix and match vocabs. However, as:Organization has specific semantics that schema:Organization doesn’t, so it’s necessary for interoperability with ActivityPub systems to use it where appropriate.

That is one possibility, i also can add a new type definition (i don’t know if that is possible in json-ld, but in rdf-schema/owl it is.) But it’s also very strange to do that!

Organization - Schema.org Type was just one example. There are a lot of other types that are not derived from AS:Object. My AP Implementation should be a generic one. i still hold on to this wish