json-ld icon indicating copy to clipboard operation
json-ld copied to clipboard

How to load some related links in document?

Open 3DRaven opened this issue 6 months ago • 1 comments

Hello. I need help understanding some library related things. I'm trying to load a json-ld document like

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://example.social/createHelloWorldPost",
  "type": "Create",
  "actor": "https://example.social/actor",
  "to": "https://www.w3.org/ns/activitystreams#Public",
  "object": {
    "id": "https://example.social/helloWorldPost",
    "type": "Note",
    "published": "2023-11-05T12:00:00Z",
    "attributedTo": "https://example.social/actor",
    "to": "https://www.w3.org/ns/activitystreams#Public",
    "inReplyTo": "https://friends.grishka.me/posts/884435",
    "content": "<p>Привет, федивёрс</p>"
  }
}

Everything loads and I get an ExpandedDocument. But I would like not only links in the context to be loaded, but also some links in the document, automatically being embedded in the document, for example, so that, based on the context, the library would figure out that inReplyTo is a link to another document and automatically load it. I would also like to control which links are loaded. Is it possible to do this or maybe you can recommend the way I should extend json-ld?

And please explain how, using json-ld, you can interpret data in fields based on their type? The context describes the semantics of the field and its type; this data can be used in some way?

3DRaven avatar Aug 02 '24 21:08 3DRaven