OpenGovLD / specs

Linked Data vocabulary and API for parliamentary and committee information systems
17 stars 1 forks source link

CamelCase versus snake_case #106

Open akuckartz opened 9 years ago

akuckartz commented 9 years ago

The last draft of OParl uses CamelCase (reason: compatibility with RDF conventions). Popolo prefers snaked_case (reason: compatibility with ORMs):

If an implementation serializes to JSON, its serializations must validate against this specification's JSON Schema. http://www.popoloproject.com/specs/#conformance

As described in the conformance section, JSON serializations must validate against the JSON Schema (draft v3) below. The terms use snake case (birth_date) instead of camel case (birthDate), due to its popularity among ORMs. http://www.popoloproject.com/specs/#serialization

jpmckinney commented 9 years ago

Note that the proposed opengov: namespaced terms are camelCase - it's just the JSON serialization that switches case.

akuckartz commented 9 years ago

Yes, this question is a result of #105 and fortunately only concerns non-LD JSON.

I do not have a good idea on what to do regarding JSON. I would like JSON serializations to be implementable without additional effort. It might make sense to (again) declare that out of scope for OpenGovLD. I am certainly open for suggestions.

akuckartz commented 9 years ago

A property (serialization ?) can be used to indicate the JSON serialization variant. And we can decide that one of the variants is the default.

akuckartz commented 9 years ago

Profiles can be used to determine different JSON serialisations, but that mechanism perhaps is to complicated.

The 'profile' Link Relation Type https://www.ietf.org/rfc/rfc6906.txt

Profiles could be (examples):

That could help to avoid spending effort on discussing different application/json serializations. I am not that interested in application/json anyway ;-)

See also:

The Profile URI Registry https://datatracker.ietf.org/doc/rfc7284/

akuckartz commented 9 years ago

schema.org prefers CamelCase:

Note on naming conventions Schema.org uses the following naming convention. We request that you follow this naming convention for your extensions as well.

  • Types and Enumerations start with a capital letter and are CamelCase.
  • Properties start with a lower case letter and are also camelCase.

https://schema.org/docs/extension.html