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

[JTS] Extend JSON Table Schema to support typed field validation #96

Closed
ldodds opened this issue Jan 27, 2014 · 7 comments
Closed

[JTS] Extend JSON Table Schema to support typed field validation #96

ldodds opened this issue Jan 27, 2014 · 7 comments

Comments

@ldodds
Copy link
Contributor

ldodds commented Jan 27, 2014

This proposal builds on #95. Background here: https://github.com/theodi/csv-validation-research/wiki/Extending-Data-Packages-to-Support-CSV-File-Validation

Allow a JTS to include:

  • type -- specify data type using XML Schema, not current short list of types
  • minimum -- minimum value of field, e.g. lowest number or earliest date
  • maximum -- maximum value of a field, e.g. highest number or latest date

The current values for type might be better based on the data types in XML Schema. This provides a well documented and well supported range of basic data types. These could be supplemented with additional values where necessary. For CSV validation use cases a broader range of basic data and date types would be useful.

The pattern keyword described in #95 would allow types to be properly parsed.

Date-time formats could be based on strftime: http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html

@rufuspollock
Copy link
Contributor

Re types I'm mixed about expanding too much. What exactly would we add? See also #89 for @type support based on JSON-LD - wdyt?

Also why would minimum / maximum be here rather than #95 (or are they descriptors rather than constraints?)

@ldodds
Copy link
Contributor Author

ldodds commented Jan 27, 2014

JSON-LD @type is used to specify a "node type" (e.g. the URI of a type of resource, such as Person) or a "value type". Its the latter that is equivalent to what I'm proposing here. JSON-LD uses URIs for type values, which we could use here, or just use the simple type names.

I'm suggesting that we allow any of the XML Schema datatypes to be used as they have well-specified formats/value spaces. I think the range of different date types is useful too. We could constrain it, but I think there's value in having a well-defined set of types, no need to reinvent the well if XSD has them already.

I see minimum/maximum as being distinct from min/maxLength because the latter are checking number of characters in the value, whereas the former is checking a range based on the type of the value. E.g. a minimum date or a minimum number.

@rufuspollock
Copy link
Contributor

@ldodds yes @type can be both node type or value type.

I was wondering that if that proposal went in then you'd already have xsd style support.

Re min / max i meant not that it duped but that it should go in validator proposal.

Will think a bit more.

@ldodds
Copy link
Contributor Author

ldodds commented Jan 27, 2014

re: the JSON-LD table, proposal, yes, that makes sense. Using URIs is fine with me. However I think for validation purposes you'll want to recommend a working set of types to avoid people creating new ones.

re: min/max, I separated out this discussion as I thought it might invoke more debate (e.g. on constraining the types) whereas I saw the basic validation support as relatively uncontroversial ;)

@jpmckinney
Copy link

JSON Schema has minimum and maximum - I see them as the same sort of validations as we have in #95 (with the exception of #95's unique).

Re: @type, we can use URIs, or we can use strings that get mapped to URIs in a (optional?) @context block, as I describe in #95.

@pwalsh
Copy link
Member

pwalsh commented Jul 12, 2016

@rgrp is this relevant anymore? From the age and some of the points, I'm inclined to close as out of date.

@roll roll added the backlog label Aug 8, 2016
@rufuspollock
Copy link
Contributor

INVALID. Now out of date / obsolete.

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

No branches or pull requests

5 participants