Skip to content

Instantly share code, notes, and snippets.

@joshsh
Last active June 20, 2024 18:40
Show Gist options
  • Save joshsh/920c77dbc15aa2169d66ce68a37f71cb to your computer and use it in GitHub Desktop.
Save joshsh/920c77dbc15aa2169d66ce68a37f71cb to your computer and use it in GitHub Desktop.
OpenCypher feature model (Protobuf)
// A model for characterizing OpenCypher queries and implementations in terms of included features.
//
// Note: this is an automatically generated file. Do not edit.
syntax = "proto3";
package hydra.langs.cypher;
option java_multiple_files = true;
option java_package = "hydra.langs.cypher";
// A set of features for aggregation functions.
message AggregateFeatures {
// Whether to expect the avg() / AVG aggregate function.
bool avg = 1;
// Whether to expect the collect() / COLLECT aggregate function.
bool collect = 2;
// Whether to expect the count() / COUNT aggregate function.
bool count = 3;
// Whether to expect the max() / MAX aggregate function.
bool max = 4;
// Whether to expect the min() / MIN aggregate function.
bool min = 5;
// Whether to expect the sum() / SUM aggregate function.
bool sum = 6;
}
// A set of features for arithmetic operations.
message ArithmeticFeatures {
// Whether to expect the + operator.
bool plus = 1;
// Whether to expect the - operator.
bool minus = 2;
// Whether to expect the * operator.
bool multiply = 3;
// Whether to expect the / operator.
bool divide = 4;
// Whether to expect the % operator.
bool modulus = 5;
// Whether to expect the ^ operator.
bool power_of = 6;
}
// A set of features for various kinds of atomic expressions.
message AtomFeatures {
// Whether to expect CASE expressions.
bool case_expression = 1;
// Whether to expect the COUNT (*) expression.
bool count = 2;
// Whether to expect existential subqueries.
bool existential_subquery = 3;
// Whether to expect function invocation.
bool function_invocation = 4;
// Whether to expect list comprehensions, and if so, which specific features
ListComprehensionFeatures list_comprehension = 5;
// Whether to expect literal values, and if so, which specific features
LiteralFeatures literal = 6;
// Whether to expect parameter expressions.
bool parameter = 7;
// Whether to expect pattern comprehensions.
bool pattern_comprehension = 8;
// Whether to expect relationship patterns as subexpressions.
bool pattern_predicate = 9;
// Whether to expect quantifier expressions, and if so, which specific features
QuantifierFeatures quantifier = 10;
// Whether to expect variable expressions (note: included by most if not all implementations).
bool variable = 11;
}
// A set of features for comparison operations.
message ComparisonFeatures {
// Whether to expect the = comparison operator.
bool equal = 1;
// Whether to expect the > comparison operator.
bool greater_than = 2;
// Whether to expect the >= comparison operator.
bool greater_than_or_equal = 3;
// Whether to expect the < comparison operator.
bool less_than = 4;
// Whether to expect the <= comparison operator.
bool less_than_or_equal = 5;
// Whether to expect the <> comparison operator.
bool not_equal = 6;
}
// A set of features which characterize an OpenCypher query or implementation. Any features which are omitted from the set are assumed to be unsupported or nonrequired.
message CypherFeatures {
// Whether to expect aggregate functions, and if so, which specific features
AggregateFeatures aggregate = 1;
// Whether to expect arithmetic operations, and if so, which specific features
ArithmeticFeatures arithmetic = 2;
// Whether to expect atomic expressions, and if so, which specific features
AtomFeatures atom = 3;
// Whether to expect comparison operations, and if so, which specific features
ComparisonFeatures comparison = 4;
// Whether to expect delete operations, and if so, which specific features
DeleteFeatures delete = 5;
// Whether to expect built-in functions, and if so, which specific features
FunctionFeatures function = 6;
// Whether to expect logical operations, and if so, which specific features
LogicalFeatures logical = 7;
// Whether to expect match queries, and if so, which specific features
MatchFeatures match = 8;
// Whether to expect merge operations, and if so, which specific features
MergeFeatures merge = 9;
// Whether to expect node patterns, and if so, which specific features
NodePatternFeatures node_pattern = 10;
// Whether to expect IS NULL / IS NOT NULL checks, and if so, which specific features
NullFeatures null = 11;
// Whether to expect path functions, and if so, which specific features
PathFeatures path = 12;
// Whether to expect procedure calls, and if so, which specific features
ProcedureCallFeatures procedure_call = 13;
// Whether to expect projection operations, and if so, which specific features
ProjectionFeatures projection = 14;
// Whether to expect range literals, and if so, which specific features
RangeLiteralFeatures range_literal = 15;
// Whether to expect reading operations, and if so, which specific features
ReadingFeatures reading = 16;
// Whether to expect relationship directions, and if so, which specific features
RelationshipDirectionFeatures relationship_direction = 17;
// Whether to expect relationship patterns, and if so, which specific features
RelationshipPatternFeatures relationship_pattern = 18;
// Whether to expect remove operations, and if so, which specific features
RemoveFeatures remove = 19;
// Whether to expect schema functions, and if so, which specific features
SchemaFeatures schema = 20;
// Whether to expect set operations, and if so, which specific features
SetFeatures set = 21;
// Whether to expect string operations, and if so, which specific features
StringFeatures string = 22;
// Whether to expect updating operations, and if so, which specific features
UpdatingFeatures updating = 23;
}
// A set of features for delete operations.
message DeleteFeatures {
// Whether to expect the basic DELETE clause.
bool delete = 1;
// Whether to expect the DETACH DELETE clause.
bool detach_delete = 2;
}
// A set of features for list comprehensions.
message ListComprehensionFeatures {
// Whether to expect basic list comprehensions.
bool list_comprehension = 1;
// Whether to expect list range comprehensions (e.g. [1..10]).
bool list_range = 2;
}
// A set of features for various types of literal values.
message LiteralFeatures {
// Whether to expect boolean literals (note: included by most if not all implementations).
bool boolean = 1;
// Whether to expect double-precision floating-point literals.
bool double = 2;
// Whether to expect integer literals.
bool integer = 3;
// Whether to expect list literals.
bool list = 4;
// Whether to expect map literals.
bool map = 5;
// Whether to expect the NULL literal.
bool null = 6;
// Whether to expect string literals (note: included by most if not all implementations).
bool string = 7;
}
// A set of features for logical operations.
message LogicalFeatures {
// Whether to expect the AND operator.
bool and = 1;
// Whether to expect the NOT operator.
bool not = 2;
// Whether to expect the OR operator.
bool or = 3;
// Whether to expect the XOR operator.
bool xor = 4;
}
// A set of features for match queries.
message MatchFeatures {
// Whether to expect OPTIONAL MATCH.
bool optional = 1;
}
// A set of features for merge operations.
message MergeFeatures {
// Whether to expect the basic MERGE clause.
bool merge = 1;
// Whether to expect MERGE with the ON CREATE action.
bool merge_on_create = 2;
// Whether to expect MERGE with the ON MATCH action.
bool merge_on_match = 3;
}
// A set of features for node patterns.
message NodePatternFeatures {
// Whether to expect specifying multiple labels in a node pattern.
bool multiple_labels = 1;
// Whether to expect specifying a parameter as part of a node pattern.
bool parameter = 2;
// Whether to expect specifying a key/value map of properties in a node pattern.
bool property_map = 3;
// Whether to expect binding a variable to a node in a node pattern (note: included by most if not all implementations).
bool variable_node = 4;
// Whether to expect omitting labels from a node pattern.
bool wildcard_label = 5;
}
// A set of features for IS NULL / IS NOT NULL checks.
message NullFeatures {
// Whether to expect the IS NULL operator.
bool is_null = 1;
// Whether to expect the IS NOT NULL operator.
bool is_not_null = 2;
}
// A set of features for path functions.
message PathFeatures {
// Whether to expect the length() function.
bool length = 1;
// Whether to expect the shortestPath() function.
bool shortest_path = 2;
}
// A set of features for procedure calls.
message ProcedureCallFeatures {
// Whether to expect CALL within a query.
bool in_query_call = 1;
// Whether to expect standalone / top-level CALL.
bool standalone_call = 2;
// Whether to expect the YIELD clause in CALL.
bool yield = 3;
}
// A set of features for projections.
message ProjectionFeatures {
// Whether to expect the LIMIT clause.
bool limit = 1;
// Whether to expect the ORDER BY clause.
bool order_by = 2;
// Whether to expect the DISTINCT keyword.
bool project_distinct = 3;
// Whether to expect the * projection.
bool project_all = 4;
// Whether to expect the AS keyword.
bool project_as = 5;
// Whether to expect the SKIP clause.
bool skip = 6;
// Whether to expect the ASC/ASCENDING and DESC/DESCENDING keywords.
bool sort_order = 7;
}
// A set of features for quantifier expressions.
message QuantifierFeatures {
// Whether to expect the ALL quantifier.
bool all = 1;
// Whether to expect the ANY quantifier.
bool any = 2;
// Whether to expect the NONE quantifier.
bool none = 3;
// Whether to expect the SINGLE quantifier.
bool single = 4;
}
// A set of features for range literals within relationship patterns.
message RangeLiteralFeatures {
// Whether to expect range literals with both lower and upper bounds.
bool bounds = 1;
// Whether to expect range literals providing an exact number of repetitions.
bool exact_range = 2;
// Whether to expect range literals with a lower bound (only).
bool lower_bound = 3;
// Whether to expect the * range literal.
bool star_range = 4;
// Whether to expect range literals with an upper bound (only).
bool upper_bound = 5;
}
// A set of features for specific syntax related to reading data from the graph..
message ReadingFeatures {
// Whether to expect the UNION operator.
bool union = 1;
// Whether to expect the UNION ALL operator.
bool union_all = 2;
// Whether to expect the UNWIND clause.
bool unwind = 3;
}
// A set of features for relationship directions / arrow patterns.
message RelationshipDirectionFeatures {
// Whether to expect the two-headed arrow (<-[]->) relationship direction.
bool both = 1;
// Whether to expect the left arrow (<-[]-) relationship direction.
bool left = 2;
// Whether to expect the headless arrow (-[]-) relationship direction.
bool neither = 3;
// Whether to expect the right arrow (-[]->) relationship direction.
bool right = 4;
}
// A set of features for relationship patterns.
message RelationshipPatternFeatures {
// Whether to expect specifying a disjunction of multiple types in a relationship pattern.
bool multiple_types = 1;
// Whether to expect binding a variable to a relationship in a relationship pattern (note: included by most if not all implementations).
bool variable_relationship = 2;
// Whether to expect omitting types from a relationship pattern.
bool wildcard_type = 3;
}
// A set of features for REMOVE operations.
message RemoveFeatures {
// Whether to expect REMOVE Variable:NodeLabels.
bool by_label = 1;
// Whether to expect REMOVE PropertyExpression.
bool by_property = 2;
}
// A set of features for schema functions.
message SchemaFeatures {
// Whether to expect the type() function.
bool type = 1;
}
// A set of features for set definitions.
message SetFeatures {
// Whether to expect defining a set using PropertyExpression = Expression.
bool property_equals = 1;
// Whether to expect defining a set using Variable = Expression.
bool variable_equals = 2;
// Whether to expect defining a set using Variable += Expression.
bool variable_plus_equals = 3;
// Whether to expect defining a set using Variable:NodeLabels.
bool variable_with_node_labels = 4;
}
// A set of features for string functions.
message StringFeatures {
// Whether to expect the contains() / CONTAINS aggregate function.
bool contains = 1;
// Whether to expect the endsWith() / ENDS WITH aggregate function.
bool ends_with = 2;
// Whether to expect the in() / IN aggregate function.
bool in = 3;
// Whether to expect the startsWith() / STARTS WITH aggregate function.
bool starts_with = 4;
}
// A set of features for specific syntax related to updating data in the graph.
message UpdatingFeatures {
// Whether to expect the CREATE clause.
bool create = 1;
// Whether to expect the SET clause.
bool set = 2;
// Whether to expect multi-part queries using WITH.
bool with = 3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment