Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default JSON-LD context #48

Open
pietercolpaert opened this issue Nov 16, 2023 · 2 comments
Open

Default JSON-LD context #48

pietercolpaert opened this issue Nov 16, 2023 · 2 comments

Comments

@pietercolpaert
Copy link
Member

JSON-LD can lower the barrier for adoption of Linked Data when given clear rules on how to implement the JSON frame. @phochste proposed to have, in this repository, also a standard JSON-LD context that can be use for a default frame

@pietercolpaert pietercolpaert changed the title Default JSON-LD context for a simple JSON-LD frame to be used by non Linked Data developers Default JSON-LD context Nov 16, 2023
@pietercolpaert
Copy link
Member Author

pietercolpaert commented Nov 16, 2023

I created a first proposal of a JSON-LD context and what a JSON document would look like then:

The context

{
  "@context": {
      "tree": "https://w3id.org/tree#",
      "ldes": "https://w3id.org/ldes#",
      "shape": { "@type":"@id", "@id":"tree:shape"},
      "xsd": "http://www.w3.org/2001/XMLSchema#",
      "EventStream": "ldes:EventStream",
      "node": {"@type": "@id", "@id": "tree:node"},
      "members": {"@type": "@id", "@id": "tree:member"},
      "relations": {"@id": "tree:relation"},
      "view": {"@id": "tree:view"},
      "path": {"@container": "@list", "@id": "tree:path", "@type": "@id"},
      "value": {"@id":"tree:value"},
      "timestampPath": {"@id":"ldes:timestampPath", "@type":"@id", "@container":"@list"},
      "versionOfPath": {"@id":"ldes:versionOfPath", "@type":"@id", "@container":"@list"},
      "retention": {"@id":"ldes:retentionPolicy"},
      "amount": {"@id":"ldes:amount","@type":"xsd:integer"}
    }
}

An implementation

{
  "@context": [
    {
      "@base": "https://example.org/",
      "ex": "https://example.org/",
      "as": "https://www.w3.org/ns/activitystreams#"
    },
    "https://w3id.org/ldes/context.jsonld"
  ],
  "@id": "ex:MyEventStream",
  "@type": "EventStream",
  "shape": "ex:shaclShape",
  "timestampPath": "as:published",
  "members": [
    {
      "@id": "ex:Activity1",
      "@type": "as:Create",
      "as:published": "2023-11-30",
      "as:object": "ex:S",
      "@graph": {
        "@id": "ex:S",
        "ex:P": "O"
      }
    },
    {
      "@id": "ex:Activity2",
      "@type": "as:Update",
      "as:published": "2023-11-30",
      "as:object": "ex:S",
      "@graph": {
        "@id": "ex:S",
        "ex:P": "O2"
      }
    }
  ],
  "view": {
    "@id": "",
    "@comment": "↑ this must be a URI to the current page (which is satisfied here through it being relative)",
    "retention": {
      "@type":"ldes:LatestVersionSubset",
      "amount": "2",
      "versionOfPath": "as:object"
    },
    "relations": [
    	{
          "@type" : "tree:GreaterThanRelation",
          "value": {
            "@value": "2023-11-30",
            "@type": "xsd:date"
          },
          "path": "as:published",
          "node": "/Node2"
        },
        {
          "@type" : "tree:LessThanRelation",
          "value": {
            "@value": "2023-12-30",
            "@type": "xsd:date"
          },
          "path": "as:published",
          "node": "/Node2"
        }
    ]
  }
}

@sandervd
Copy link

It seems that ABB has created a JSON-LD context:
https://ipdc.vlaanderen.be/ldes.jsonld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants