Open szarnyasg opened 7 years ago
Some thoughts:
type()
returns a single stringlabels()
returns a collection of stringsproperties()
returns a mapkeys()
returns a collection of stringsPropagating these in the Rete network should be the responsibility of the inferencer classes, the most likely candidate being the ExtraAttributeInferencer. Where should we propagate these?
type()
, the GetEdgesOperator should add the type to the edge as an additional element (string) in the tuple.labels()
, either the GetVerticesOperator or the respective endpoint (source/target) of the GetEdgesOperator should add the labels as an additional element (list of strings) in the tuple.properties()
and keys()
work for both vertices and edges and should be provided by the respective nullary operator: the GetEdgesOperator for edges, and the GetVerticesOperator/GetEdgesOperator for vertices.Also, m:Message
-style expressions could also be considered to be metaqueries as they are a special case of 'Message' IN labels(m)
-style expressions.
:NodeLabel
-style expressions now work, except when there are joins (expands or plain Cartesian products), in which case the schema inferencer just crashes because it does not propagate the variable either way.
MATCH (message2:Message) //, (x:X)
RETURN message2:Comment AS isComment
Related queries with the following exception:
java.lang.AssertionError: assertion failed: Some properties were not propagated to either side of the join-like operator at scala.Predef$.assert(Predef.scala:170) at ingraph.compiler.plantransformers.NPlanToFPlan$.transform(NPlanToFPlan.scala:94)
LDBC SNB / Interactive / complex / 2
MATCH (:Person {id:19791209300143})-[:KNOWS]-(friend:Person)<-[:HAS_CREATOR]-(message)
WHERE message.creationDate <= 20121128000000000 AND (message:Post OR message:Comment)
RETURN
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
message.id AS postOrCommentId,
CASE exists(message.content)
WHEN true THEN message.content
ELSE message.imageFile
END AS postOrCommentContent,
message.creationDate AS postOrCommentCreationDate
ORDER BY postOrCommentCreationDate DESC, toInteger(postOrCommentId) ASC
LIMIT 20
TCK "MatchAcceptance2": "Multiple anonymous nodes in a pattern"
MATCH (a)<--()<--(b)-->()-->(c)
WHERE a:A
RETURN c
TCK "OptionalMatchAcceptance": "Return null when no matches due to label predicate in WHERE"
MATCH (n:Single)
OPTIONAL MATCH (n)-[r]-(m)
WHERE m:NonExistent
RETURN r
We should definitely support
labels()
andtype()
. I am not sure aboutproperties()
andkeys()
.