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

Spec naming style #54

Closed
will-moore opened this issue Sep 1, 2021 · 13 comments · Fixed by #70
Closed

Spec naming style #54

will-moore opened this issue Sep 1, 2021 · 13 comments · Fixed by #70

Comments

@will-moore
Copy link
Member

When looking to add new keys to the spec I wonder how to name e.g. position_x I wonder what the naming style should be e.g.

  • position_x
  • positionX
  • position-x
  • positionx

Looking at the current spec, we have all of these styles there already, reflecting the origin of various terms (mea culpa):

  • image-label
  • defaultT - Rendering definition (omero). to be replaced by rendering spec?
  • maximumfieldcount - HCS, to be replace by Collections spec
  • field_count - Also HCS.

So, which of these do we prefer? Python style, Java style or something else?

@constantinpape
Copy link
Contributor

We should absolutely have a consistent naming style. I would personally vote for snake case (python style) but I don't have a strong opinion and camel case (java style) would also be fine with me.

@glyg
Copy link
Contributor

glyg commented Sep 2, 2021

I agree with @constantinpape (1. snake case, 2. camelCase) with a rather strong rejection of the "postion-x" just because I know I'll have to parse out the dash sign at some point and I'm lazy, and a very strong rejection of "positionx" because it will be confusing with e.g. the curvilinear coordinate "s"

@joshmoore
Copy link
Member

Similar to the "dashes don't work great in programming languages", I'd add that casing isn't always that clear with URLs. Since I expect these identifiers will eventually get used in such contexts, I'd favor position_x over positionX.

@jburel
Copy link
Member

jburel commented Oct 8, 2021

If we wish to follow the style in place in schema.org, positionX should be used

@jburel
Copy link
Member

jburel commented Oct 8, 2021

From comment on ome/omero-cli-render#55

My comment is more general that this specific issue. The suggestion of following schema.org is coming from the fact that others efforts e.g. bioschema.org, ro-crate follow that convention so it might make more sense to follow similar rule instead of the snake_case convention
especially if we start interacting. I can see for example in a zarr file
the original data, the segmented data, and the workflow used to generated the segmented data.
The workflow will/might follow the ro-crate convention if published on workflowhub for example so the user won't spend time converting the json, this means that will lead to either multiple conventions in the file or metadata not being added at all.

@jburel
Copy link
Member

jburel commented Oct 8, 2021

see also https://www.ebi.ac.uk/spot/oxo/docs/api (ontologies related)

@constantinpape
Copy link
Contributor

Given ongoing PRs in #57 etc. it would be good to come to a decision here. Given the usage of camelCase in schema.org it seems like this would be the prefered choice.
Any objections against that?

@joshmoore
Copy link
Member

joshmoore commented Oct 18, 2021

@glyg had the strongest objection in #54 (comment). I'm personally tend towards underscores (i.e. more PEP8)

@constantinpape
Copy link
Contributor

I read #54 (comment) as being fine with both camel or snake case, just objecting (rightfully in my opinion) to position-x or positionx.

@joshmoore
Copy link
Member

Ah, I see. I misread.

@glyg
Copy link
Contributor

glyg commented Oct 19, 2021

Hi, I feel @constantinpape argument for camel case as being already in use at schema.org wins - my python tropism maybe clouds my judgement :) - I guess you can always work around the lowercase url issue?

@will-moore
Copy link
Member Author

I don't know if we're actually going to use schema.org, but it seems that many schemas and data-models tend to use camelCase so in the interests of consistency I think that makes the most sense.
I think @joshmoore is OK with camelCase too?
So hopefully that's looking like a new consensus...

@will-moore
Copy link
Member Author

Opened a PR at #70 to add the camelCase naming convention to the spec.

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

Successfully merging a pull request may close this issue.

5 participants