int-salmon-data-lab / statusAndTrends

Datasets and related knowledge from the IYS Salmon Status and Trends workshops
Other
1 stars 1 forks source link

Relationship type names violate the Neo4j naming conventions #5

Open jimtyhurst opened 5 years ago

jimtyhurst commented 5 years ago

I came across Neo4j's naming conventions in their Cypher Manual (https://neo4j.com/docs/cypher-manual/current/syntax/naming/). Currently, the statusAndTrends database (https://9fb1063a.databases.neo4j.io/) violates the naming convention for Relationship types. The Neo4j convention is to use all upper case with underscore to separate words (:HAS_PLACE), but our schema currently uses camel case starting with lowercase (:hasPlace), which is also used as the naming convention for property names (startInterval: '1959-01-01T00:00-UTC').

Possible fix #1: Change the code to follow the Neo4j naming convention.

Possible fix #2: Document ISDL's naming conventions.

ScottAkenhead commented 5 years ago

They recommend mixing two styles:

(:Noun{withType:’adjective’})-[HAS_VERB]-(:Noun)

which is ugly, jarring. Shouting, in all caps, ditto, IMHO (🙃). Plus what we are doing has little to do with corporation DB programmers.

To compromise, how about my pythonCase ‘hasLink’ becomes CamelCase ‘HasLink’ ? That way there is one, consistent style. Named fields and variables stay pythonCase? (bigFat:Person {eatsMainly:’junk food’ })

RoundTable style is (:person) but I propose we override that, use (:Person). Typically nodes for things refer to Proper nouns (:Place{label:’Portland’, ...}) just as a justification.

ScottAkenhead commented 5 years ago

We will have many node labels and many {type:} within each, and many named fields, so worth distinguishing top level nodes and links (start with caps) from subordinate details. I vote for your Plan B, instead of their PLAN_B.