Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

simplify json-ld #11

Description

@edsu

It might be worthwhile to simplify the JSON-LD a bit by using a more verbose context and referencing it from the json-ld. For example:

{
  "@context": "http://project-open-data.github.io/context.json",
  "title": "HealthData.gov Catalog Hub",
  "homepage": "http://hub.healthdata.gov",
  "dataset": [
    {
      "@id": "http://hub.healthdata.gov",
      "@type": "dcat:Catalog",   
      "title": "HealthData.gov Catalog Hub",
      "homepage": "http://hub.healthdata.gov",
      "dataset": [
        {
          "@id": "http://hub.healthdata.gov/dataset/7ab73b9c-238d-4a41-b789-679664810d02",
          "@type": "dcat:Dataset",
          "title": "Nursing Home Profile",
          "keyword": [
            "complaint",
            "enforcement",
            "inspection",
            "nursing homes"
          ],
          ...
        }
      },
    },
    ... 
  ]
}

and then you'd serve up the context at http://project-open-data.github.io/context.json:

{
  "@context": {
    "title": "http://purl.org/dc/terms/title",
    "homepage": "http://xmlns.com/foaf/0.1/homepage",
    "dataset": "http://www.w3.org/ns/dcat#dataset",
    "keyword": "http://www.w3.org/ns/dcat#keyword",
    ...
  }
}

The main advantages are:

  • the JSON-LD looks more like the current JSON, with an eye towards possibly folding them together?
  • implementers wouldn't need to repeat the context (perhaps incorrectly) in their own data.json files
  • the JSON could be used more idiomatically from Javascript: e.g. datasets.title instead of datasets['title'].

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions