I think it’s not correct when #ActivityPub thought leaders consider JSON-LD a schema definition language.
-
I think it’s not correct when #ActivityPub thought leaders consider JSON-LD a schema definition language. I don't think it's an effective alternative to JSON Schema (for JSON) or SHACL or ShEx (for RDF). JSON-LD can’t be used to describe structure and constraints of data, for example. It's primarily an RDF serialization and the only benefit I see for AP is preventing property name clashes when doing full JSON-LD processing. I hope this topic will be reconsidered someday in ActivityPub 2.0.
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
Huh? The context used in ActivityPub refers to a well-defined RDFS vocabulary, well suited for schema verification. Of course, the serialization does not enforce the schema. It neither does when using JSON Schema.
-
Steve Batereplied to Nik | Klampfradler 🎸🚲 last edited by
@nik What's this well-defined RDFS vocabulary (vs the normative JSON-LD context)? Do you mean the non-normative (and non-maintained) AS2 OWL ontology? A JSON Schema definition could define constraints that can be used for plain JSON message validation (and developer documentation) for specific AP interoperability domains (microblogging, forums, online markets, etc.). And it would be useful for non-RDF (plain JSON) consumers given AP is primarily intended to be used in that context (per @evan ).
-
-
@evan @nik Using the OWL Ontology for validation is not ideal for multiple reasons. 1) It's not maintained, 2) it's not complete (only AS2, no AP), 3) it's not fully consistent with normative AS2, 4) it requires RDF, which requires JSON-LD processing of AP messages, 5) if you want message validation, you'll need write code to do something that already exists (SHACL, ShEx). I recommend JSON Schema for plain JSON applications.
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
-
Steve Batereplied to Nik | Klampfradler 🎸🚲 last edited by
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
-
-
Nik | Klampfradler 🎸🚲replied to Evan Prodromou last edited by [email protected]
-
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
-
Steve Batereplied to Nik | Klampfradler 🎸🚲 last edited by
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
The JSON-LD context is a link to a schema. It really is. That's its definition. Exactly that and nothing else.
It does not assume the schema definition language used to define the schema, though. Currently, the AP context points to a RDFS vocabulary defining the schema.
The $schema in JSON Schema is a link to a schema. The only difference to JSON-LD's context is that it imposes a specific schema definition language, and one that is fundamentally incompatible with the web.
-
Steve Batereplied to Nik | Klampfradler 🎸🚲 last edited by
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by
-
Nik | Klampfradler 🎸🚲replied to Nik | Klampfradler 🎸🚲 last edited by
Having plain JSON and a JSON Schema definition means there is one final schema definition, and all extensions would need to fork the schema into a new protocol. JSON Schema allows for extensions only by allowing unknown fields that are not defined by a schema.
We should not do that. It's a bad idea for a federated protocol.
-
Steve Batereplied to Nik | Klampfradler 🎸🚲 last edited by
-
Nik | Klampfradler 🎸🚲replied to Steve Bate last edited by