Giter Club home page Giter Club logo

rql-parser's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rql-parser's Issues

contains should contain either value or nested expression

Hi, really great project!

I'm implementing a Custom Visitor, and it seems from: https://github.com/jazdw/rql-parser/blob/main/src/main/antlr4/net/jazdw/rql/Rql.g4
that contains PredicateOperator can only have a value and not a nested expression.

What I am trying to accomplish is to query a specific field (name) from a list of objects (categories) with multiple values (in operator):
Query:

and(
    in(
      globalProductReferenceId.id, (123567, 891011)
    ),
    in(
      group, (service, addon)
    ),
    contains(
      categories,
      in(
        name,
        (mobile, Roaming)
      )
    )
  )
[
    {
        "name": "TEST",
        "description": "TEST",
        "label": "TEST",
        "status": "TEST",
        "categories": [
            {
                "name": "mobile",
                "id": "TEST"
            },
            {
                "name": "TEST",
                "id": "TEST_2"
            }
        ],
        "globalProductReferenceId": {
            "id": "123567"
        },
        "group": "service"
    },
    {
        "name": "TEST",
        "description": "TEST",
        "label": "TEST",
        "status": "TEST",
        "categories": [
            {
                "name": "mobile",
                "id": "TEST"
            }
        ],
        "globalProductReferenceId": {
            "id": "891011"
        },
        "group": "addon"
    }
]

Do you have any suggestion on how to proceed?

ASTNode parent is always null

ASTNode parent is always null, I suspect the bug is that ASTNode.createChildNode at ASTNode:78 uses this.arguments.add(child) instead of ASTNode.addArgument.

Parsing the Sub Beans or Sub Objects

Hi,
I have a bean which has some nested objects such as another collection of custom objects and I want to filter those on nested properties.
Can you have anything helpful in regards to this or anything in the roadmap or suggest any custom implementation for the same.

Values containing slashes ("/") parse incorrectrly as arrays

It is not possible to write queries in the form of:

eq(property,/value/containing/slashes)

because the value field will be converted to [,value,containing,slashes]

As I understand this parsing should only be applied to property fields and not value fields.

Relevant code:

if (query.contains("/")) {
matcher = SLASHED_PATTERN.matcher(query);
query = new RegexReplacer(matcher) {
public String replaceWith() {
return "(" + matcher.group().replace("/", ",") + ")";
}
}.replace();
}

Does not handle != properly

If the query contains 'foo!=3' the parser will identify 'foo!' as the property '=' as the operator and '3' as the value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.