that doesn’t sound right – the JSON-LD stuff works on the context document at https://www.w3.org/ns/activitystreams.jsonld which does contain Public
being defined as as:Public
which expands to the full https://www.w3.org/ns/activitystreams#Public
using the playground at JSON-LD Playground with the following document:
{
"@context": "https://www.w3.org/ns/activitystreams",
"to": "https://www.w3.org/ns/activitystreams#Public",
"https://www.w3.org/ns/activitystreams#cc": "Public",
"bcc": "Public",
"https://www.w3.org/ns/activitystreams#bto": "https://www.w3.org/ns/activitystreams#Public"
}
if you look at the expanded form, you see that the IRI forms do not use the definition from context. they get parsed as a @value
and not an @id
in the expanded form. when they get compacted down against the same context, the as:
is preserved but the actual definition is not. so for some reason, the reference JSON-LD parser being used on the playground does not equate a term with its IRI, neither the full IRI nor the compact IRI:
[
{
"https://www.w3.org/ns/activitystreams#bto": [
{
"@value": "https://www.w3.org/ns/activitystreams#Public"
}
],
"https://www.w3.org/ns/activitystreams#bcc": [
{
"@id": "Public"
}
],
"https://www.w3.org/ns/activitystreams#cc": [
{
"@value": "Public"
}
],
"https://www.w3.org/ns/activitystreams#to": [
{
"@id": "https://www.w3.org/ns/activitystreams#Public"
}
]
}
]
{
"@context": "https://www.w3.org/ns/activitystreams",
"bcc": "Public", // linked node
"as:bto": "https://www.w3.org/ns/activitystreams#Public", // string literal
"as:cc": "Public", // string literal
"to": "as:Public" // linked node
}
the activitypub spec gives this hint:
5.6 Note:
Compacting an ActivityStreams object using the ActivityStreams JSON-LD context might result in https://www.w3.org/ns/activitystreams#Public
being represented as simply Public
or as:Public
which are valid representations of the Public collection. Implementations which treat ActivityStreams objects as simply JSON rather than converting an incoming activity over to a local context using JSON-LD tooling should be aware of this and should be prepared to accept all three representations.
it’s not invalid, it’s just not recommended by the JSON-LD spec. i’m not super invested in having this included though, so i can take it out. i can replace this bit with a link to 9.15.1 Expanded Term Definitions in JSON-LD 1.1 in the absence of any other perspectives.
i’m unsure this is necessary. i understand the reasoning behind it, but it can be useful to use such terms. for example, in the discussion around payment links, it came up that you may want to differentiate between Paypal
, Cashapp
, etc. without parsing every single href
for a prefix. i am not sure what legal requirements may surround something like this
not necessarily. we could set up the redirect rules for the old format as present in the commented out lines. having the new folder format just makes it easier.