Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
FenTiger
FenTiger
@fentiger@zotum.net  ·  activity timestamp 9 months ago

Another nail in the coffin for # JsonLD:

{
    "id": "https://zotum.net/conversation/235e8736-1b3e-4d7f-ab9e-3d49f04ecda7",
    "orderedItems": [
        {
            "type": "Add",
            "object": {
                "type": "Create",
                "object": {
                    "type": "Note",
                    "id": "https://zotum.net/item/235e8736-1b3e-4d7f-ab9e-3d49f04ecda7",
                    "published": "2025-02-25T20:28:33Z",
                    [... original version of post ... ]
                },
            },
        },
        {
            "type": "Add",
            "object": {
                "type": "Update",
                "object": {
                    "type": "Note",
                    "id": "https://zotum.net/item/235e8736-1b3e-4d7f-ab9e-3d49f04ecda7",
                    "published": "2025-02-25T20:28:33Z",
                    "updated": "2025-02-25T20:29:03Z",
                    [... edited version of post ...]
                },

That's a post that I edited shortly after I first made it. The corresponding conversation container contains both the original Create, and an Update with the changes. This means that the embedded Note object appears twice, with different contents, but with the same ID.

JSON-LD processing will kind of squish them together into the same object that contains both the original and the new content etc. Handling this as JSON-LD will mean recognising the high level structure of it first, and then iterating over the orderedItems and processing them individually, rather than trying to treat the whole thing as a single JSON-LD message.

# ActivityPubDev

  • Copy link
  • Flag this post
  • Block
FenTiger
FenTiger
@fentiger@zotum.net replied  ·  activity timestamp 9 months ago

Contrived? It's real. You can fetch it from the original URL and look at it yourself if you like.

As for why it's a nail in the coffin ... if you have to start out by interpreting it as plain JSON then why would you want to switch to another format/representation later? That would just add complexity and make the code more confusing.

So I'm slowly but surely coming to the conclusion that my RDF-ish internal representation has to go. Convenient though it is in some ways, it's just not robust enough, and mangles real-world messages too often to be relied on. 😞

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.22 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct