Last active
March 27, 2022 03:55
-
-
Save aneeshdurg/4d39c4df650aa35fa36308bbd3650153 to your computer and use it in GitHub Desktop.
A OpenCypher query to create a graph modelling the heirarchy of OpenCypher expressions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE | |
(OC_AddOrSubtractExpression :AddOrSubtractExpression), | |
(OC_AndExpression :AndExpression), | |
(OC_AnonymousPatternPart :AnonymousPatternPart), | |
(OC_Atom :Atom), | |
(OC_BooleanLiteral :BooleanLiteral), | |
(OC_CaseAlternatives :CaseAlternatives), | |
(OC_CaseExpression :CaseExpression), | |
(OC_ComparisonExpression :ComparisonExpression), | |
(OC_Create :Create), | |
(OC_Cypher :Cypher), | |
(OC_Dash :Dash), | |
(OC_Delete :Delete), | |
(OC_DoubleLiteral :DoubleLiteral), | |
(OC_ExplicitProcedureInvocation :ExplicitProcedureInvocation), | |
(OC_Expression :Expression), | |
(OC_FilterExpression :FilterExpression), | |
(OC_FunctionInvocation :FunctionInvocation), | |
(OC_FunctionName :FunctionName), | |
(OC_IdInColl :IdInColl), | |
(OC_ImplicitProcedureInvocation :ImplicitProcedureInvocation), | |
(OC_InQueryCall :InQueryCall), | |
(OC_IntegerLiteral :IntegerLiteral), | |
(OC_LabelName :LabelName), | |
(OC_LeftArrowHead :LeftArrowHead), | |
(OC_Limit :Limit), | |
(OC_ListComprehension :ListComprehension), | |
(OC_ListLiteral :ListLiteral), | |
(OC_ListOperatorExpression :ListOperatorExpression), | |
(OC_Literal :Literal), | |
(OC_MapLiteral :MapLiteral), | |
(OC_Match :Match), | |
(OC_MergeAction :MergeAction), | |
(OC_Merge :Merge), | |
(OC_MultiPartQuery :MultiPartQuery), | |
(OC_MultiplyDivideModuloExpression :MultiplyDivideModuloExpression), | |
(OC_Namespace :Namespace), | |
(OC_NodeLabel :NodeLabel), | |
(OC_NodeLabels :NodeLabels), | |
(OC_NodePattern :NodePattern), | |
(OC_NotExpression :NotExpression), | |
(OC_NullOperatorExpression :NullOperatorExpression), | |
(OC_NumberLiteral :NumberLiteral), | |
(OC_OrExpression :OrExpression), | |
(OC_Order :Order), | |
(OC_Parameter :Parameter), | |
(OC_ParenthesizedExpression :ParenthesizedExpression), | |
(OC_PartialComparisonExpression :PartialComparisonExpression), | |
(OC_PatternComprehension :PatternComprehension), | |
(OC_Pattern :Pattern), | |
(OC_PatternElementChain :PatternElementChain), | |
(OC_PatternElement :PatternElement), | |
(OC_PatternPart :PatternPart), | |
(OC_PowerOfExpression :PowerOfExpression), | |
(OC_ProcedureName :ProcedureName), | |
(OC_ProcedureResultField :ProcedureResultField), | |
(OC_ProjectionBody :ProjectionBody), | |
(OC_ProjectionItem :ProjectionItem), | |
(OC_ProjectionItems :ProjectionItems), | |
(OC_Properties :Properties), | |
(OC_PropertyExpression :PropertyExpression), | |
(OC_PropertyKeyName :PropertyKeyName), | |
(OC_PropertyLookup :PropertyLookup), | |
(OC_PropertyOrLabelsExpression :PropertyOrLabelsExpression), | |
(OC_Query :Query), | |
(OC_RangeLiteral :RangeLiteral), | |
(OC_ReadingClause :ReadingClause), | |
(OC_RegularQuery :RegularQuery), | |
(OC_RelTypeName :RelTypeName), | |
(OC_RelationshipDetail :RelationshipDetail), | |
(OC_RelationshipPattern :RelationshipPattern), | |
(OC_RelationshipTypes :RelationshipTypes), | |
(OC_RelationshipsPattern :RelationshipsPattern), | |
(OC_Remove :Remove), | |
(OC_RemoveItem :RemoveItem), | |
(OC_ReservedWord :ReservedWord), | |
(OC_Return :Return), | |
(OC_RightArrowHead :RightArrowHead), | |
(OC_SchemaName :SchemaName), | |
(OC_Set :Set), | |
(OC_SetItem :SetItem), | |
(OC_SinglePartQuery :SinglePartQuery), | |
(OC_SingleQuery :SingleQuery), | |
(OC_Skip :Skip), | |
(OC_SortItem :SortItem), | |
(OC_StandaloneCall :StandaloneCall), | |
(OC_Statement :Statement), | |
(OC_StringListNullOperatorExpression :StringListNullOperatorExpression), | |
(OC_StringOperatorExpression :StringOperatorExpression), | |
(OC_SymbolicName :SymbolicName), | |
(OC_UnaryAddOrSubtractExpression :UnaryAddOrSubtractExpression), | |
(OC_Union :Union), | |
(OC_Unwind :Unwind), | |
(OC_UpdatingClause :UpdatingClause), | |
(OC_Variable :Variable), | |
(OC_Where :Where), | |
(OC_With :With), | |
(OC_XorExpression :XorExpression), | |
(OC_YieldItem :YieldItem), | |
(OC_YieldItems :YieldItems) | |
CREATE | |
(OC_AddOrSubtractExpression)-[:CHILD]->(OC_MultiplyDivideModuloExpression), | |
(OC_AndExpression)-[:CHILD]->(OC_NotExpression), | |
(OC_AnonymousPatternPart)-[:CHILD]->(OC_PatternElement), | |
(OC_Atom)-[:CHILD]->(OC_CaseExpression), | |
(OC_Atom)-[:CHILD]->(OC_FilterExpression), | |
(OC_Atom)-[:CHILD]->(OC_FunctionInvocation), | |
(OC_Atom)-[:CHILD]->(OC_ListComprehension), | |
(OC_Atom)-[:CHILD]->(OC_Literal), | |
(OC_Atom)-[:CHILD]->(OC_Parameter), | |
(OC_Atom)-[:CHILD]->(OC_ParenthesizedExpression), | |
(OC_Atom)-[:CHILD]->(OC_PatternComprehension), | |
(OC_Atom)-[:CHILD]->(OC_RelationshipsPattern), | |
(OC_Atom)-[:CHILD]->(OC_Variable), | |
(OC_CaseAlternatives)-[:CHILD]->(OC_Expression), | |
(OC_CaseExpression)-[:CHILD]->(OC_CaseAlternatives), | |
(OC_CaseExpression)-[:CHILD]->(OC_Expression), | |
(OC_ComparisonExpression)-[:CHILD]->(OC_AddOrSubtractExpression), | |
(OC_ComparisonExpression)-[:CHILD]->(OC_PartialComparisonExpression), | |
(OC_Create)-[:CHILD]->(OC_Pattern), | |
(OC_Cypher)-[:CHILD]->(OC_Statement), | |
(OC_Delete)-[:CHILD]->(OC_Expression), | |
(OC_ExplicitProcedureInvocation)-[:CHILD]->(OC_Expression), | |
(OC_ExplicitProcedureInvocation)-[:CHILD]->(OC_ProcedureName), | |
(OC_Expression)-[:CHILD]->(OC_OrExpression), | |
(OC_FilterExpression)-[:CHILD]->(OC_IdInColl), | |
(OC_FilterExpression)-[:CHILD]->(OC_Where), | |
(OC_FunctionInvocation)-[:CHILD]->(OC_Expression), | |
(OC_FunctionInvocation)-[:CHILD]->(OC_FunctionName), | |
(OC_FunctionName)-[:CHILD]->(OC_Namespace), | |
(OC_FunctionName)-[:CHILD]->(OC_SymbolicName), | |
(OC_IdInColl)-[:CHILD]->(OC_Expression), | |
(OC_IdInColl)-[:CHILD]->(OC_Variable), | |
(OC_ImplicitProcedureInvocation)-[:CHILD]->(OC_ProcedureName), | |
(OC_InQueryCall)-[:CHILD]->(OC_ExplicitProcedureInvocation), | |
(OC_InQueryCall)-[:CHILD]->(OC_YieldItems), | |
(OC_LabelName)-[:CHILD]->(OC_SchemaName), | |
(OC_Limit)-[:CHILD]->(OC_Expression), | |
(OC_ListComprehension)-[:CHILD]->(OC_Expression), | |
(OC_ListComprehension)-[:CHILD]->(OC_FilterExpression), | |
(OC_ListLiteral)-[:CHILD]->(OC_Expression), | |
(OC_ListOperatorExpression)-[:CHILD]->(OC_Expression), | |
(OC_ListOperatorExpression)-[:CHILD]->(OC_PropertyOrLabelsExpression), | |
(OC_Literal)-[:CHILD]->(OC_BooleanLiteral), | |
(OC_Literal)-[:CHILD]->(OC_ListLiteral), | |
(OC_Literal)-[:CHILD]->(OC_MapLiteral), | |
(OC_Literal)-[:CHILD]->(OC_NumberLiteral), | |
(OC_MapLiteral)-[:CHILD]->(OC_Expression), | |
(OC_MapLiteral)-[:CHILD]->(OC_PropertyKeyName), | |
(OC_Match)-[:CHILD]->(OC_Pattern), | |
(OC_Match)-[:CHILD]->(OC_Where), | |
(OC_MergeAction)-[:CHILD]->(OC_Set), | |
(OC_Merge)-[:CHILD]->(OC_MergeAction), | |
(OC_Merge)-[:CHILD]->(OC_PatternPart), | |
(OC_MultiPartQuery)-[:CHILD]->(OC_ReadingClause), | |
(OC_MultiPartQuery)-[:CHILD]->(OC_SinglePartQuery), | |
(OC_MultiPartQuery)-[:CHILD]->(OC_UpdatingClause), | |
(OC_MultiPartQuery)-[:CHILD]->(OC_With), | |
(OC_MultiplyDivideModuloExpression)-[:CHILD]->(OC_PowerOfExpression), | |
(OC_Namespace)-[:CHILD]->(OC_SymbolicName), | |
(OC_NodeLabel)-[:CHILD]->(OC_LabelName), | |
(OC_NodeLabels)-[:CHILD]->(OC_NodeLabel), | |
(OC_NodePattern)-[:CHILD]->(OC_NodeLabels), | |
(OC_NodePattern)-[:CHILD]->(OC_Properties), | |
(OC_NodePattern)-[:CHILD]->(OC_Variable), | |
(OC_NotExpression)-[:CHILD]->(OC_ComparisonExpression), | |
(OC_NumberLiteral)-[:CHILD]->(OC_DoubleLiteral), | |
(OC_NumberLiteral)-[:CHILD]->(OC_IntegerLiteral), | |
(OC_OrExpression)-[:CHILD]->(OC_XorExpression), | |
(OC_Order)-[:CHILD]->(OC_SortItem), | |
(OC_Parameter)-[:CHILD]->(OC_SymbolicName), | |
(OC_ParenthesizedExpression)-[:CHILD]->(OC_Expression), | |
(OC_PartialComparisonExpression)-[:CHILD]->(OC_AddOrSubtractExpression), | |
(OC_PatternComprehension)-[:CHILD]->(OC_Expression), | |
(OC_PatternComprehension)-[:CHILD]->(OC_RelationshipsPattern), | |
(OC_PatternComprehension)-[:CHILD]->(OC_Variable), | |
(OC_Pattern)-[:CHILD]->(OC_PatternPart), | |
(OC_PatternElementChain)-[:CHILD]->(OC_NodePattern), | |
(OC_PatternElementChain)-[:CHILD]->(OC_RelationshipPattern), | |
(OC_PatternElement)-[:CHILD]->(OC_NodePattern), | |
(OC_PatternElement)-[:CHILD]->(OC_PatternElement), | |
(OC_PatternElement)-[:CHILD]->(OC_PatternElementChain), | |
(OC_PatternPart)-[:CHILD]->(OC_AnonymousPatternPart), | |
(OC_PatternPart)-[:CHILD]->(OC_Variable), | |
(OC_PowerOfExpression)-[:CHILD]->(OC_UnaryAddOrSubtractExpression), | |
(OC_ProcedureName)-[:CHILD]->(OC_Namespace), | |
(OC_ProcedureName)-[:CHILD]->(OC_SymbolicName), | |
(OC_ProcedureResultField)-[:CHILD]->(OC_SymbolicName), | |
(OC_ProjectionBody)-[:CHILD]->(OC_Limit), | |
(OC_ProjectionBody)-[:CHILD]->(OC_Order), | |
(OC_ProjectionBody)-[:CHILD]->(OC_ProjectionItems), | |
(OC_ProjectionBody)-[:CHILD]->(OC_Skip), | |
(OC_ProjectionItem)-[:CHILD]->(OC_Expression), | |
(OC_ProjectionItem)-[:CHILD]->(OC_Variable), | |
(OC_ProjectionItems)-[:CHILD]->(OC_ProjectionItem), | |
(OC_Properties)-[:CHILD]->(OC_MapLiteral), | |
(OC_Properties)-[:CHILD]->(OC_Parameter), | |
(OC_PropertyExpression)-[:CHILD]->(OC_Atom), | |
(OC_PropertyExpression)-[:CHILD]->(OC_PropertyLookup), | |
(OC_PropertyKeyName)-[:CHILD]->(OC_SchemaName), | |
(OC_PropertyLookup)-[:CHILD]->(OC_PropertyKeyName), | |
(OC_PropertyOrLabelsExpression)-[:CHILD]->(OC_Atom), | |
(OC_PropertyOrLabelsExpression)-[:CHILD]->(OC_NodeLabels), | |
(OC_PropertyOrLabelsExpression)-[:CHILD]->(OC_PropertyLookup), | |
(OC_Query)-[:CHILD]->(OC_RegularQuery), | |
(OC_Query)-[:CHILD]->(OC_StandaloneCall), | |
(OC_RangeLiteral)-[:CHILD]->(OC_IntegerLiteral), | |
(OC_ReadingClause)-[:CHILD]->(OC_InQueryCall), | |
(OC_ReadingClause)-[:CHILD]->(OC_Match), | |
(OC_ReadingClause)-[:CHILD]->(OC_Unwind), | |
(OC_RegularQuery)-[:CHILD]->(OC_SingleQuery), | |
(OC_RegularQuery)-[:CHILD]->(OC_Union), | |
(OC_RelTypeName)-[:CHILD]->(OC_SchemaName), | |
(OC_RelationshipDetail)-[:CHILD]->(OC_Properties), | |
(OC_RelationshipDetail)-[:CHILD]->(OC_RangeLiteral), | |
(OC_RelationshipDetail)-[:CHILD]->(OC_RelationshipTypes), | |
(OC_RelationshipDetail)-[:CHILD]->(OC_Variable), | |
(OC_RelationshipPattern)-[:CHILD]->(OC_Dash), | |
(OC_RelationshipPattern)-[:CHILD]->(OC_LeftArrowHead), | |
(OC_RelationshipPattern)-[:CHILD]->(OC_RelationshipDetail), | |
(OC_RelationshipPattern)-[:CHILD]->(OC_RightArrowHead), | |
(OC_RelationshipTypes)-[:CHILD]->(OC_RelTypeName), | |
(OC_RelationshipsPattern)-[:CHILD]->(OC_NodePattern), | |
(OC_RelationshipsPattern)-[:CHILD]->(OC_PatternElementChain), | |
(OC_Remove)-[:CHILD]->(OC_RemoveItem), | |
(OC_RemoveItem)-[:CHILD]->(OC_NodeLabels), | |
(OC_RemoveItem)-[:CHILD]->(OC_PropertyExpression), | |
(OC_RemoveItem)-[:CHILD]->(OC_Variable), | |
(OC_Return)-[:CHILD]->(OC_ProjectionBody), | |
(OC_SchemaName)-[:CHILD]->(OC_ReservedWord), | |
(OC_SchemaName)-[:CHILD]->(OC_SymbolicName), | |
(OC_Set)-[:CHILD]->(OC_SetItem), | |
(OC_SetItem)-[:CHILD]->(OC_Expression), | |
(OC_SetItem)-[:CHILD]->(OC_NodeLabels), | |
(OC_SetItem)-[:CHILD]->(OC_PropertyExpression), | |
(OC_SetItem)-[:CHILD]->(OC_Variable), | |
(OC_SinglePartQuery)-[:CHILD]->(OC_ReadingClause), | |
(OC_SinglePartQuery)-[:CHILD]->(OC_Return), | |
(OC_SinglePartQuery)-[:CHILD]->(OC_UpdatingClause), | |
(OC_SingleQuery)-[:CHILD]->(OC_MultiPartQuery), | |
(OC_SingleQuery)-[:CHILD]->(OC_SinglePartQuery), | |
(OC_Skip)-[:CHILD]->(OC_Expression), | |
(OC_SortItem)-[:CHILD]->(OC_Expression), | |
(OC_StandaloneCall)-[:CHILD]->(OC_ExplicitProcedureInvocation), | |
(OC_StandaloneCall)-[:CHILD]->(OC_ImplicitProcedureInvocation), | |
(OC_StandaloneCall)-[:CHILD]->(OC_YieldItems), | |
(OC_Statement)-[:CHILD]->(OC_Query), | |
(OC_StringListNullOperatorExpression)-[:CHILD]->(OC_ListOperatorExpression), | |
(OC_StringListNullOperatorExpression)-[:CHILD]->(OC_NullOperatorExpression), | |
(OC_StringListNullOperatorExpression)-[:CHILD]->(OC_PropertyOrLabelsExpression), | |
(OC_StringListNullOperatorExpression)-[:CHILD]->(OC_StringOperatorExpression), | |
(OC_StringOperatorExpression)-[:CHILD]->(OC_PropertyOrLabelsExpression), | |
(OC_UnaryAddOrSubtractExpression)-[:CHILD]->(OC_StringListNullOperatorExpression), | |
(OC_Union)-[:CHILD]->(OC_SingleQuery), | |
(OC_Unwind)-[:CHILD]->(OC_Expression), | |
(OC_Unwind)-[:CHILD]->(OC_Variable), | |
(OC_UpdatingClause)-[:CHILD]->(OC_Create), | |
(OC_UpdatingClause)-[:CHILD]->(OC_Delete), | |
(OC_UpdatingClause)-[:CHILD]->(OC_Merge), | |
(OC_UpdatingClause)-[:CHILD]->(OC_Remove), | |
(OC_UpdatingClause)-[:CHILD]->(OC_Set), | |
(OC_Variable)-[:CHILD]->(OC_SymbolicName), | |
(OC_Where)-[:CHILD]->(OC_Expression), | |
(OC_With)-[:CHILD]->(OC_ProjectionBody), | |
(OC_With)-[:CHILD]->(OC_Where), | |
(OC_XorExpression)-[:CHILD]->(OC_AndExpression), | |
(OC_YieldItem)-[:CHILD]->(OC_ProcedureResultField), | |
(OC_YieldItem)-[:CHILD]->(OC_Variable), | |
(OC_YieldItems)-[:CHILD]->(OC_Where), | |
(OC_YieldItems)-[:CHILD]->(OC_YieldItem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment