Is this valid in #ActivityPub / AS2 ?
-
Is this valid in #ActivityPub / AS2 ?
{
"@context": "https://www.w3.org/ns/activitystreams",
...
"tag": [
{
"type": "Hashtag",
"name": "example",
"href": "https://example.com/tag/example"
}
}
Note that "Hashtag" is not a term in the normative AP/AS2 context. It seems to break linked data processing, but it also seems to pass the JSON-LD compaction requirements of AS2 (based on the JSON-LD Playground). If true, this means you can use extended types without extending the context. βοΈ -
@steve "valid" as in it triggers no failure cases: probably. "valid" as in someone knows what to do with it: probably not.
I base this on section 5 of the activitystreams core spec: https://www.w3.org/TR/activitystreams-core/#extensibility
-
@steve Hashtag is part of this Community Group Report: "ActivityPub Miscellaneous Terms" https://swicg.github.io/miscellany/ I think the implication is that this will be added to the spec when the working group is fully spun up again, but it also defines a JSON-LD context for itself that you can use today if you want to be both compatible with Mastodon and compliant with JSON-LD.
-
@steve it is in the miscellaneous terms document.
-
@thisismissem @julian I'm aware of the unofficial term, but that wasn't my point. That term is not included in the example document's JSON-LD context (normative or otherwise). It doesn't seem like a good practice although there's an example like this in the ActivityPub book. Mastodon uses Hashtag, but it includes the term in the extended JSON-LD context. It appears that one can include *any* undefined type (and other terms?) without them being in the context and it's technically allowed.
-
@mariusor Mastodon knows what to do with it even without the Mastodon/AP extensions in the context (it doesn't require the extensions to be in the context). However, it would require some patching of the AP document (or injection of additional context) prior to JSON-LD processing to be used by a linked data consumer.
-
-
infinite love β΄³replied to Steve Bate last edited by [email protected]
@steve @thisismissem @julian this is due to
"@\vocab": "_:"
in the context document. it's a pre-JSON-LD 1.0 feature that got obsoleted by JSON-LD 1.0 and i think deprecated in JSON-LD 1.1?
https://www.w3.org/TR/json-ld11/#changes-from-cg and #h-note-0 and #h-note-41 say:
> The use of blank node identifiers to label properties is obsolete, and may be removed in a future version of JSON-LD, as is the support for generalized RDF Datasets.
> Blank node identifiers begin with _: