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

Clarify optional field representation in GeoJSON feed ouput - create a JSON Schema #73

Closed
j-d-b opened this issue Feb 20, 2020 · 6 comments
Labels
Feed-related This issue is related to the feed output, format, distribution method, etc

Comments

@j-d-b
Copy link
Collaborator

j-d-b commented Feb 20, 2020

Clarify optional field representation in GeoJSON feed ouput - create a JSON Schema

Background

Currently, some WZDx fields are optional. The intention of an optional field is to allow pieces of information that:

  • May not apply to a certain road event (e.g. milepost); or
  • Are unable to be provided by a significant amount of data producers (e.g. worker presence)

to be included when relevant or if available.

However, the spec doesn't clarify how an optional piece of data that is intended to have no value should be represented in the GeoJSON feed output.

Representing a value-less optional field in the feed output

There are two (reasonable) ways to accomplish this:

  1. The JSON property for an optional piece of data (e.g. beginning_milepost) is still required to be present in the GeoJSON feed output but its value should be null if it is inapplicable/unable to be filled out.
  2. The JSON property for an optional piece of data without a value should not be present in the GeoJSON feed output.

Implementing the clarification

The chosen representation from the previous section could be clarified with an additional paragraph of text in the create-feed README, however, a better approach would be to describe the representation by creating a schema for the GeoJSON feed output. A JSON schema leaves nothing up to interpretation by the reader and has the additional benefit of allowing feed producers to validate their feed output. I believe this benefit makes it worth the additional time to create over just adding a block of explanatory text.

@lynnerandolph
Copy link

We would definitely like to see this occur!

@j-d-b j-d-b added the Feed-related This issue is related to the feed output, format, distribution method, etc label Apr 1, 2020
@natedeshmukhtowery
Copy link
Collaborator

natedeshmukhtowery commented Apr 2, 2020

Agree with the need for a JSON Schema. My only substantive concern at this point would be that a JSON Schema would need to be consistent with what the WZDx specification has tried to balance so far - allowing for the diversity of existing approaches but trying to bring some degree of harmony.

If folks think that a JSON Schema is a helpful approach to feed validation that doesn't become too prescriptive, then it seems to be a very useful, even critical, tool to have.

Thoughts?

Also worth noting that a team at 18F developed a validator for v1.1 WZDx JSON feeds, which may be a possible place to build from: https://github.com/18F/usdot-jpo-ode-workzone-data-exchange

@j-d-b
Copy link
Collaborator Author

j-d-b commented Apr 2, 2020

@natedeshmukhtowery can you clarify what you mean by the following?

allowing for the diversity of existing approaches but trying to bring some degree of harmony

The JSON Schema would allow for as much diversity of implementation as possible given the required fields and GeoJSON required structure.

I'm glad to see there was a JSON Schema for v1.1, thank you for linking to it. I feel as though we should definitely go ahead with this for v2. I'll begin putting that together for review.

@j-d-b
Copy link
Collaborator Author

j-d-b commented Apr 2, 2020

Note also we still need community consensus on how we want to represent value-less optional fields, as described in the first issue comment text.

@natedeshmukhtowery
Copy link
Collaborator

@j-d-b your following sentence clarifies sufficiently - as long as the JSON schema allows for as much diversity of implementation as possible given the required elements and GeoJSON structure, I'm 100% comfortable. This is the sharp edge of where my technical knowledge ends...

Thanks for moving forward with a v2 Schema draft - agree that there needs to be additional discussion on the value-less optional fields - @sknick-iastate, @DeraldDudley and others - any thoughts?

@j-d-b
Copy link
Collaborator Author

j-d-b commented May 29, 2020

Resolved in #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feed-related This issue is related to the feed output, format, distribution method, etc
Projects
None yet
Development

No branches or pull requests

3 participants