{"id":21011811,"url":"https://github.com/khellang/quaero","last_synced_at":"2026-03-05T10:31:54.664Z","repository":{"id":164122615,"uuid":"639575724","full_name":"khellang/Quaero","owner":"khellang","description":"A small query language that can transform queries into Microsoft Graph, Active Directory and SCIM filters","archived":false,"fork":false,"pushed_at":"2025-08-29T07:54:26.000Z","size":595,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T09:55:33.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khellang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-11T18:44:22.000Z","updated_at":"2025-08-29T07:54:29.000Z","dependencies_parsed_at":"2023-10-16T11:51:24.691Z","dependency_job_id":"f8337fe1-458b-4177-95ac-13d93b220bf9","html_url":"https://github.com/khellang/Quaero","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/khellang/Quaero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FQuaero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FQuaero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FQuaero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FQuaero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khellang","download_url":"https://codeload.github.com/khellang/Quaero/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FQuaero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30119427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:31:24.526Z","updated_at":"2026-03-05T10:31:54.644Z","avatar_url":"https://github.com/khellang.png","language":"C#","readme":"# Quaero\n\nA small query language that can transform queries into system-specific filters.\n\nQuaero is designed to be web-friendly by using letter-based operators instead of symbols. It's very similar to Microsoft Graph (OData) and SCIM filter syntax.\nSee [example queries](#example-queries) for some examples.\n\nThis repository contains translation implementations for Microsoft Graph, Active Directory (LDAP) and SCIM filters, as well as in-memory predicates.\n\n## Supported operators\n\nThe language supports a wide range of operators supported by most filter/query languages.\n\n### Equality operators\n\n- Equals (`eq`)\n- Not equals (`ne`)\n- Logical negation (`not`)\n- In (`in`)\n\n### Relational operators\n\n- Less than (`lt`)\n- Greater than (`gt`)\n- Less than or equal to (`le`)\n- Greater than or equal to (`ge`)\n\n### Conditional operators\n\n- And (`and`)\n- Or (`or`)\n\n### Functions\n\n- Starts with (`sw`)\n- Ends with (`ew`)\n- Contains (`co`)\n\n## Example queries\n\n| Quaero                                         | Microsoft Graph                                | LDAP                                                    | SCIM                                                |\n|------------------------------------------------|------------------------------------------------|---------------------------------------------------------|-----------------------------------------------------|\n| `age gt 42`                                    | `age gt 42`                                    | `(age\u003e=43)`                                             | `age gt 42`                                         |\n| `age ge 42`                                    | `age ge 42`                                    | `(age\u003e=42)`                                             | `age ge 42`                                         |\n| `age lt 42`                                    | `age lt 42`                                    | `(age\u003c=41)`                                             | `age lt 42`                                         |\n| `age le 42`                                    | `age le 42`                                    | `(age\u003c=42)`                                             | `age le 42`                                         |\n| `name eq \"John\"`                               | `name eq 'John'`                               | `(name=John)`                                           | `name eq \"John\"`                                    |\n| `not(name eq \"John\")`                          | `name ne 'John'`                               | `(!(name=John))`                                        | `name ne \"John\"`                                    |\n| `department in [\"Retail\", \"Sales\"]`            | `department in ('Retail', 'Sales')`            | `(\\|(department=Retail)(department=Sales))`             | `(department eq \"Retail\" or department eq \"Sales\")` |\n| `isRead eq false`                              | `isRead eq false`                              | `(isRead=FALSE)`                                        | `isRead eq false`                                   |\n| `mail ew \"outlook.com\"`                        | `endsWith(mail, 'outlook.com')`                | `(mail=*outlook.com)`                                   | `mail ew \"outlook.com\"`                             |\n| `parent ne null`                               | `parent ne null`                               | `(parent=*)`                                            | `parent pr`                                         |\n| `name pr`                                      | `name ne null`                                 | `(name=*)`                                              | `name pr`                                           |\n| `id eq \"275e50ae-ceb8-4f33-9e68-b3b9dc87ea68\"` | `id eq '275e50ae-ceb8-4f33-9e68-b3b9dc87ea68'` | `(id=\\AE\\50\\5E\\27\\B8\\CE\\33\\4F\\9E\\68\\B3\\B9\\DC\\87\\EA\\68)` | `id eq \"275e50ae-ceb8-4f33-9e68-b3b9dc87ea68\"`      |\n\n## Usage\n\nEither parse a filter expression from a string using `Filter.Parse` or `Filter.TryParse`:\n\n```csharp\nFilter filter = Filter.Parse(\"age gt 42\");\n```\n\nOr manually construct a filter expression using the factory methods on the `Filter` class:\n\n```csharp\nFilter filter = Filter.GreaterThan(\"age\", 42);\n```\n\nOnce the filter has been successfully parsed, it can be optimized by calling the `Optimize` extension method. This will take care of removing redundancies and shortening the resulting query.\n\nTo transform the query into an LDAP filter, reference the `Quaero.Ldap` package and call the `ToLdapFilter` method on it:\n\n```csharp\nstring result = filter.ToLdapFilter();\n```\n\nFor Microsoft Graph, reference the `Quaero.MicrosoftGraph` package and call `ToMicrosoftGraphFilter` on the filter:\n\n```csharp\nstring result = filter.ToMicrosoftGraphFilter();\n```\n\nAnd for SCIM, reference the `Quaero.Scim` package and call `ToScimFilter` on the filter:\n\n```csharp\nstring result = filter.ToScimFilter();\n```\n\nIf you want to evaluate a filter in-memory, you can call the `ToPredicate\u003cT\u003e` method on it:\n\n```csharp\nrecord Person(string Name, int Age);\nFunc\u003cPerson, bool\u003e predicate = filter.ToPredicate\u003cPerson\u003e();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2Fquaero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhellang%2Fquaero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2Fquaero/lists"}