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

Field datatype not locked down by JSON Schema #116

Open
martinjoconnor opened this issue Oct 31, 2018 · 3 comments
Open

Field datatype not locked down by JSON Schema #116

martinjoconnor opened this issue Oct 31, 2018 · 3 comments

Comments

@martinjoconnor
Copy link
Member

martinjoconnor commented Oct 31, 2018

We do not lock down the datatypes of fields in the JSON Schema @type specification for fields.

For example, here is the specification for the @value and @type fields for date field instances:

      "properties": {
        "@value": { "type": [ "string", "null" ] },
        "rdfs:label": { "type": [ "string", "null" ] },
        "@type": { "type": "string", "format": "uri" }
      },
      "required": [ "@value", "@type" ],

The @type field is restricted to a URI only when it should be restricted to xsd:date.

@johardi
Copy link
Member

johardi commented Nov 1, 2018

We don't lock down the @type value to a specific data type (i.e., using enum) to give users the freedom to set their own data type

@martinjoconnor
Copy link
Member Author

martinjoconnor commented Nov 1, 2018

But that should be locked down by the template. A date field instance, for example, should only have the type xsd:date. The only place a user has freedom to set the value for the @type is for templates and element.

@martinjoconnor
Copy link
Member Author

I will agree that this may be tricky to do in practice because we would need a different specification for each type of field. Which is why I didn't put it in the 2.3 milestone. We can discuss to see if the extra effort is worth it.

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

No branches or pull requests

2 participants