ldbc / gcore-spark

Implementation of the G-CORE graph query language on Spark
Apache License 2.0
15 stars 5 forks source link

Implement missing semantic checks #20

Open peterboncz opened 6 years ago

peterboncz commented 6 years ago
  1. Expression types match for binary expressions (if possible to check)

  2. (?) An edge is between two distinct vertices

  3. Variable bindings in SimpleMatchClause have different names. Note: Bindings can be re-used across multiple SimpleMatchClauses. HOWEVER, edges should not be reused.

  4. Ambiguous labeling of entities. For example, in queries such as:(v1:L1)->(v2)<-(v3), (v1:L2)v1 is labeled differently in the two patterns.

  5. .Eliminate similar queries? For example:(v1:L1)->(v2), (v3:L1)->(v4)v1 and v3 are the same Vertex, v2 and v4 will be the same vertex, their edges are the same too, it’s a repeated query, which we translate into a join over the two edges.

  6. Validate that all keys in edgeRestriction (GraphSchema) are present in the graph. Also validate that all values in edgeRestrictions are present in the graph.

  7. ALL PATHS can only be used with stored paths

  8. (?) Throw error or warn the user if, after label inference, an entity can have more than one label. This translates into a UNION ALL of all labels for that entity.

  9. Each match variable must be matched on only one graph. Validation should go in MapBindingToGraph.

  10. All variables in an edge or path pattern should be part of the same graph. Validation should go in MapBindingToGraph.

  11. (?) An EXISTS subquery must have at least one common variable with the main MATCH clause.

  12. UnionAll operator is applied on two relations with the same header.

  13. Property exists for given label, or exists for given entity type.

  14. Property types match with Expression types.

  15. (?) No two Table’s contain the same id.

  16. A constructed entity must be of the same type as its matched counterpart, if they are the same variable (this can be checked in CreateGroupingSets).

  17. A specific GROUP clause can only be used with unbound variables. This can be checked in CreateGroupingSets

  18. Check that each variable in CONSTRUCT ends up in the end with at most one label - if the label is missing, then we can create a new one in VertexCreate. This check can be done in CreateGroupingSets.

  19. Are aggregate expressions allowed in the MATCH’s WHERE clause?

  20. An entity can only be GROUP-ed once, or else the GROUP-ings must be combined.

ramhgarcias commented 6 years ago
  1. Preserve immutability of objects. For instance, it is not possible to change the source node of an edge.