openreferral / specification

The Human Services Data Specification - a data exchange format developed by the Open Referral Initiative
https://openreferral.org
Other
117 stars 49 forks source link

`service_area` and `language` tables have fields with same name. #296

Closed Cskyleryoung closed 8 months ago

Cskyleryoung commented 2 years ago

There are two fields names in HSDS that are the same as their table names:

This is heuristically sloppy, and actually creates a really problem in some database/analytics systems like BigQuery, where referencing the field actually references the whole table (when the names are the same) and nests it in the resulting selected data. Because you can actually nest tables in BigQuery (and perhaps other emerging database technology).

I strongly recommend we update these field names so they aren't the same as their table names.

What should we call them?

We already have some common and more generic heuristics in the spec that we can draw on, the two most notable being name and description.

service_area.description works great. I believe @mikethacker has already suggested service_area.extant, which also works well.

Likewise, language.name is more readable than language.language.

My official proposal.

Taking it one step further?

Some of the small tables almost have the same issue of duplicate names:

Would these be more readable and consistent as follows?

Renaming these fields if definitely not something I'm going to die on the sword over. Whereas the first two (service_area and language) are actually rather critical, these last three are maybe nice to haves. I felt I had to mention them for consistency's sake, since they so nearly fall into the same category.

greggish commented 2 years ago

thanks for bringing this up skyler. i'm not sure i understand the meaning of extant in this context. my impression of the word is that it refers to the continued existence of something old from the past.

MikeThacker1 commented 2 years ago

I think the term should be "extent". This refers to the polygon defining the area. See rows 190 and 191 of Por20349 - HSDS - US and UK.

However, the proposal (in row 188) is to rename "service_area.service_areas to service_area.name.

mrshll1001 commented 8 months ago

Closing this since as of 3.0, neither language nor service_area have fields with the same name as their object/table