Skip to content

Allow binding of ownerships to anonymous variables in query patterns #279

Open
@james-whiteside

Description

@james-whiteside

Problem to Solve

Currently, the query:

match
$p isa person, has name;

makes logical sense but is not valid syntax. This represents a request for all people who have a name, without binding that name.

Current Workaround

This query can already be equivalently executed with the syntax:

match
$p isa person, has name $n;
get $p;

but in general the way get changes the answer set has led to confusion for some users, plus the currently invalid syntax is more readable and intuitive.

Proposed Solution

Allow syntax of the form:

match
$t isa thing, has attribute;

as shorthand for:

match
$t isa thing, has attribute $a;
get $t;

Additional Information

This might not be possible if it leads to ambiguity in how a query could be interpreted by the parser, and so needs some thorough consideration first.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions