Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include logical property value query operators #228

Open
jasongoodwin opened this issue Jan 8, 2022 · 1 comment
Open

Include logical property value query operators #228

jasongoodwin opened this issue Jan 8, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jasongoodwin
Copy link
Contributor

jasongoodwin commented Jan 8, 2022

A query should be able to say how multiple property value checks combine:

Eg:
get vertices where name == "john" OR address == "111 elm street"
Also need to be able to bracket and group them: (name = "john" OR address == "111 elm street") AND active = "yes"
Multiple property value checks is easy, but figuring out how to group them in brackets in the proto api would be challenging.
Not sure how to do that.

This is somewhat related to:
#227

@ysimonson ysimonson added enhancement New feature or request help wanted Extra attention is needed labels Feb 10, 2022
@KevinMGranger
Copy link

KevinMGranger commented Oct 10, 2022

For the proto, you can use a list of queries, and just mark if it's and or or. For example:

// A query for vertices.
message VertexQuery {
    oneof query {
        RangeVertexQuery range = 1;
        SpecificVertexQuery specific = 2;
        PipeVertexQuery pipe = 3;
        PropertyPresenceVertexQuery property_presence = 4;
        PropertyValueVertexQuery property_value = 5;
        PipePropertyPresenceVertexQuery pipe_property_presence = 6;
        PipePropertyValueVertexQuery pipe_property_value = 7;
        MultiVertexQuery and = 8;
        MultiVertexQuery or = 9;
    }
}

// A list of VertexQueries to be used in a
// conjunction (logical and) or a disjunction (logical or).
message MultiVertexQuery {
    repeated VertexQuery queries = 1;
}

(similar for EdgeQuery). This was just a quick PoC-- if separate wrapper types for the rust enums makes more sense, then let's do that.
Edit: right, you do need separate types for impl Into<VertexQuery>. Easy enough to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants