Hi All,

There are some inconsistencies around the casing of "type constructors" in
the grammar. I'm calling these "type constructors" for a lack of a better
term but they are essentially keywords in the grammar that, when parsed,
will invoke a constructor (e.g. ReferenceVertex() or datetime()). I think
that moving forward we should establish a standard casing for these "type
constructors" to match our normal standard for classes which is PascalCase.
So datetime() should actually be DateTime().

Speaking of ReferenceVertex, the grammar for structureVertex is actually
"NEW? ('Vertex'|'ReferenceVertex') LPAREN genericLiteralArgument COMMA
stringArgument RPAREN". The "new" keyword should probably be removed as
it's not needed from a language point of view. Also, the use of "Reference"
in the name may become inaccurate as it isn't guaranteed to always be a
ReferenceVertex (it might become a DetachedVertex). The name should simply
be Vertex to reflect that it is able to fulfill all usages of vertices in
the language. The label in a Vertex is also not necessary. For example,
"g.V(Vertex)" simply uses the id of the Vertex so Vertex should only
require an id. The label can simply be defaulted to empty string as it
won't be used.

It should also be mentioned that in TINKERPOP-3023, there are proposals of
additional types to be added to the grammar for 3.8. The rules that are
established here should also apply to any of those types (notably Edge).

Summary of proposed changes:
-establish PascalCase as the standard for "type constructors" in the
grammar and add a DateTime()
-remove the new keyword
-call an element type "{Element}" rather than "Reference{Element}"
-elements shouldn't require label in the grammar

Thanks,
Ken


Related links:
https://issues.apache.org/jira/browse/TINKERPOP-3023

Reply via email to