w3c / activitystreams

Activity Streams 2.0
https://www.w3.org/TR/activitystreams-core/
Other
276 stars 61 forks source link

Compact URI speaks about "type" and "id" (not "@type" or "@id" as in JSON-LD documentation) #505

Open jonassmedegaard opened 4 years ago

jonassmedegaard commented 4 years ago

Please Indicate One:

Please Describe the Issue:

Section https://www.w3.org/TR/activitystreams-core/#compact-uris talks about using JSON-LD syntax involving "id" but https://www.w3.org/TR/json-ld/#compact-iris only talks about "@id", nowhere is "id" mentioned.

jonassmedegaard commented 4 years ago

...and "type" should also be "@type" below the example, it seems.

jonassmedegaard commented 4 years ago

...or rather, it seems that everywhere "type" should instead be "@type".

nightpool commented 4 years ago

If you look at the context document, you'll see that the type and id properties are defined as aliases of the @type and @id terms. Every JSON-LD library I've used has handled this aliasing correctly, so I don't think this is "bogus syntax"

jonassmedegaard commented 4 years ago

@nightpool which context document?

Sorry if I phrased this too strongly. And even more sorry if this turns out to be only me needing education on how to read things.

nightpool commented 4 years ago

@jonassmedgaard if you look at the beginning of each JSON-LD document, you'll see a property that says "@context": "https://www.w3.org/ns/activitystreams". this is a link to the JSON-LD context document, where all other terms that appear in the document are defined. In particular, you'll see two definitions near the top of the file:

    "id": "@id",
    "type": "@type",

these tell you how to resolve the terms type and id when you see them in the document.

jonassmedegaard commented 4 years ago

Thanks, @nightpool - makes perfect sense now, and indeed was only an issue of my comprehension.

Closing as a non-bug.

jonassmedegaard commented 4 years ago

Sorry no, I insist: It might be that ActivityStreams 2.0 generally rely on its @context defining id and @type but Example 29 in Figure 31 does not use ActivityStreams 2.0 context, and I also cannot see the following paragraphs implying an ActivityStreams 2.0 context either - seems pretty explicit to me that section 5.1 a.ka. https://www.w3.org/TR/activitystreams-core/#compact-uris is generally about JSON-LD and therefore should use the JSON-LD terms "@id" and "@type".

Specifically this sentence (my original reason for filing this issue) seem outright wrong to me:

In JSON-LD, Compact URI expansion of values applies to properties explicitly defined as "type": "id" in the @context definition.

I can only read that sentence as JSON-LD generally define a ned for type being id (not @id) which I fail to locate JSON-LD 1.0 specification stating anywhere - but I can locate it stating the opposite.

nightpool commented 4 years ago

ah, you're right, section 5.1 does appear to have a few typos in it. my guess is that this is the result of an incautious find and replace when the type and id aliases were introduced.

this sentence is correct: "Such expansion applies to all property names as well as all property values explicitly defined as type @id in the JSON-LD @context."

On Mon, Nov 4, 2019, 11:06 AM Jonas Smedegaard notifications@github.com wrote:

Reopened #505 https://github.com/w3c/activitystreams/issues/505.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w3c/activitystreams/issues/505?email_source=notifications&email_token=AABZCV2F33RFFRJKAJVCDMTQSBCBXA5CNFSM4JISPQR2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUUAIGFI#event-2768274197, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZCV7G4WR33Q3T3EDA2VDQSBCBXANCNFSM4JISPQRQ .

evanp commented 10 months ago

I have made an update to the ERRATA to note this error. The PR is here:

https://github.com/w3c/activitystreams/pull/546

Please comment on the PR if you have further input.