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

RFP: Allow additional properties at top-level #49

Open
wshayes opened this issue Jan 18, 2021 · 3 comments
Open

RFP: Allow additional properties at top-level #49

wshayes opened this issue Jan 18, 2021 · 3 comments
Assignees

Comments

@wshayes
Copy link
Member

wshayes commented Jan 18, 2021

I'd like to propose allowing additional properties by changing additionalProperties seen below to true. The purpose is to allow top-level attributes for simpler round-tripping into databases. Keeping the graph attribute tightly controlled makes a lot of sense for interoperability but allowing other top-level attributes to support easier record mgmt would make life easier for me and hopefully others when working with JGF in specific applications.

Expectation is that these additional properties would be completely ignorable when reading the JGF file in a different application - e.g. graph specific metadata should still be in graph.metadata object, application specific metadata would be the additional top-level attributes.

This would be a semantic versioning MINOR change.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://jsongraphformat.info/v2.0/json-graph-schema.json",
  "title": "JSON Graph Schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "graph": {
          "$ref": "#/definitions/graph"
        }
      },
      "additionalProperties": false,
      "required": [
        "graph"
      ]
    },
    {
      "type": "object",
      "properties": {
        "graphs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/graph"
          }
        }
      },
      "additionalProperties": false
    }
  ],
...
@wshayes wshayes self-assigned this Jan 18, 2021
@grahamwhiteuk
Copy link

Related to this, I'm attempting to extend the schema to specify a description of how my graph will work. For example, I want to specify that nodes must take one of an enumerated set of strings as their name. However, the use of additionalProperties as false everywhere in the specification means that it cannot be extended at all. A balance needs to be found between tight control versus the ability to extend.

@wshayes
Copy link
Member Author

wshayes commented Jun 7, 2022

@grahamwhiteuk I'd enjoy reviewing the design decisions with you more interactively. I'm happy to share my contact details - William dot s dot hayes at gmail dot com

Are you talking about all additionalProperties: false or just the top-level?

@grahamwhiteuk
Copy link

@wshayes can I say what fantastic response, it's great to see such a welcoming approach and willingness for open conversation. I'll ping you an email.

Very briefly though, I'm starting to see some of the difficult decisions that need to be made here and I don't think there's an ideal approach but might be worth a quick chat to check.

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