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

fix: Imports for documentation examples #118

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions documentation/modules/rql/pages/developer-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[[rql-parser]]
== RQL Parser

This Maven module contains the antlr4 grammar and the Bosch Semantic Stack RQL parser to create the _RqlQueryModel_ from a string or vice versa. For more information on antlr4, refer to https://github.com/antlr/grammars-v4[^].
This Maven module contains the antlr4 grammar and the Bosch Semantic Stack RQL parser to create the _RqlQueryModel_ from a string or vice versa.
For more information on antlr4, refer to https://github.com/antlr/grammars-v4[^].

The parser is the central tool that uses antlr4 code to analyze RQL queries and convert them into an _RqlQueryModel_.
Therefore, this module enables the interpretation of RQL queries in string format and transforms them into an internal model (RqlQueryModel) that can be further processed.
Expand Down Expand Up @@ -192,7 +193,8 @@ This can be expressed elegantly using the following construct:
<1> The original Query may well have defined it's own slice (e.g. [25:701]) this is honored throughout the process.
<2> Always exists in models generated by `Rql.getPagedQuery`.
<3> Continue requesting as long as a) the remote service returns as many items as requested and b) there are still more items to be requested in the original query.
<4> The deferral is needed so another request is only made after we get to this element. Otherwise, a `.take(15)` further up the stream would not take effect until all elements had been fetched.
<4> The deferral is needed so another request is only made after we get to this element.
Otherwise, a `.take(15)` further up the stream would not take effect until all elements had been fetched.

[[rql-query-dsl]]
== RQL to QueryDSL
Expand Down Expand Up @@ -233,15 +235,16 @@ The bridge currently supports the operators:

Top-level attributes, nested attributes, and collections of attributes can be referenced in query expressions.

In the following example, filters are defined on attributes of a `Person` entity. This `Person` entity has a `firstName` top-level attribute, an attribute `addresses` that references a sub-entity of type `Address` and a list of `Hobby` entities.
In the following example, filters are defined on attributes of a `Person` entity.
This `Person` entity has a `firstName` top-level attribute, an attribute `addresses` that references a sub-entity of type `Address` and a list of `Hobby` entities.

----
filter=eq(firstName,"John")
filter=eq(address.zipCode,1234)
filter=like(hobbies.description,"?iking*")
----

If there are multiple constraints on entries of a collection, all constraints are applied to each entry.
If there are multiple constraints on entries of a collection, all constraints are applied to each entry.

That means the following query matches persons who have a hobby with the name "ships" and that hobby's description contains "?iking*":

Expand Down Expand Up @@ -352,9 +355,9 @@ As of now the transformation process is not completely independent of the underl

[source,java]
----
import com.bosch.bci.rql.model.v1.IQueryModel;
import com.bosch.bci.rql.parser.v1.RqlParser;
import querydsl.rql.com.boschsemanticstack.QueryModelToQueryDSL;
import com.boschsemanticstack.rql.model.v1.RqlQueryModel;
import com.boschsemanticstack.rql.parser.v1.RqlParser;
import com.boschsemanticstack.rql.querydsl.QueryModelToQueryDSL;
import com.querydsl.core.types.Predicate;

public void example() {
Expand Down
Loading