W3C home > Mailing lists > Public > public-socialweb@w3.org > March 2015

Re: social-ISSUE-14 (elf-pavlik): as:Link adds a lot of complexity, if we keep it we need to clarify consequences of using it instead of as:Object [Activity Streams 2.0]

From: ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org>
Date: Fri, 27 Mar 2015 18:58:00 +0100
Message-ID: <55159A28.9070802@wwelves.org>
To: public-socialweb@w3.org
CC: Evan Prodromou <evan@e14n.com>
On 02/23/2015 02:19 PM, Social Web Working Group Issue Tracker wrote:
> social-ISSUE-14 (elf-pavlik): as:Link adds a lot of complexity, if we keep it we need to clarify consequences of using it instead of as:Object [Activity Streams 2.0]
> 
> http://www.w3.org/Social/track/issues/14
> 
> Raised by: Pavlik elf
> On product: Activity Streams 2.0

Hi Evan,

During last telecon you mentioned something about using as:Link for
other purposes than MediaObject. Could you please document other
examples when you see this construct needed?


Searching current drafts for "Link" (including "")

http://www.w3.org/TR/activitystreams-core/

11 occurences, with 10 in examples

9 for "mediaType": "image/jpeg" (MediaObject)

"object": {
    "@type": "Link",
    "href": "http://example.org/posts/1"
}

http://www.w3.org/TR/activitystreams-vocabulary/

24 occurences, with 23 in examples

4 for "mediaType": "image/jpeg" (MediaObject)
4 for "mediaType": "audio/mp3" (MediaObject)
2 for "mediaType": "video/mkv" (MediaObject)
2 for "mediaType": "application/pdf" (MediaObject ?)

5 for "mediaType": "text/html"

Than again we have somehow similar examples to the one in core spec

"current": {
    "@type": "Link",
    "displayName": "Most Recent Items",
    "href": "http://example.org/collection"
  }

"first": {
    "@type": "Link",
    "displayName": "First Page",
    "href": "http://example.org/collection"
  }

"last": {
    "@type": "Link",
    "displayName": "Last Page",
    "href": "http://example.org/collection"
  }

Which I see *VERY PROBLEMATIC*, please try to put them in JSON-LD
Playground: http://tinyurl.com/pq5jsb4

We can see that value of "as:last" has *blank node* - no @id, because of
using as:Link which uses "href". In this case I see no reason why not
use straight forward http://www.w3.org/TR/json-ld/#embedding

I see it as one of examples where as:Link makes processing more
complicated. Some people will use as:Link and others will use as:Object.
While using as:Object + embedding makes processing straight forward,
allowing as:Link almost everywhere instead of as:Object forces
publishers to choose which one they want to use and consumers to always
expect both cases.

So far I only see it used in useful way for MediaObject. Pretty much all
the other examples IMO show an anti pattern. To make it even more
visible, one could publish such funky data:


"first": {
    "@type": "Link",
    "displayName": "First Page",
    "href": "http://example.org/collection",
    "rel": "first"
  }

"last": {
    "@type": "Link",
    "displayName": "Last Page",
    "href": "http://example.org/collection",
    "rel": "last"
  }

Please notice duplication of *first* and *last*. I expect more
interesting findings once I get to automating testing of RDFa examples
in vocabulary spec...

This example from the core spec looks to me even more problematic:

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "@id": "http://example.org/foo",
  "@type": "Share",
  "displayName": "A Test",
  "actor": {
    "@type": "Person",
    "@id": "http://example.org/~sally",
    "displayName": "Sally"
  },
  "object": {
    "@type": "Link",
    "href": "http://example.org/posts/1"
  }
}

While we have perfectly clear URI for the object of this activity. When
we use standards JSON-LD processing we end up with pretty problematic
*blank node* instead. Which you can see on JSON-LD playground
http://tinyurl.com/pp28qww


Cheers!


Received on Friday, 27 March 2015 17:58:15 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 8 December 2016 15:48:21 UTC