Skip to content

Commit

Permalink
small improvements to ditto documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
  • Loading branch information
dguggemos committed Oct 11, 2021
1 parent d2cf734 commit 014d129
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ events may be filtered on the Ditto backend side before they are sent to an even
The above mentioned different APIs provide their own mechanisms on how to define such filters, but they all share the
common functionality of based on which information events may be filtered.

{% include note.html content="All filters are specified in an URL query format, therefore their values should be URL
{% include note.html content="All filters are specified in a URL query format, therefore their values should be URL
encoded before sending them to the backend. The equal (=) and the ampersand (&) character must be encoded in any RQL
filter!" %}

Expand All @@ -47,7 +47,8 @@ namespaces=org.eclipse.ditto.one,org.eclipse.ditto.two

If filtering by namespaces is not sufficient, Ditto also allows to provide an [RQL expression](basic-rql.html)
specifying:
* a Thing payload based condition determining which events should be emitted and which don't

* a Thing payload based condition determining which events should be emitted and which should not
* a filter based on the fields of the [Ditto Protocol](protocol-specification.html) message which should be filtered,
e.g.:
* using the `topic:action` placeholder as query property, filtering for lifecycle events (`created`, `deleted`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ namespaces=org.eclipse.ditto.one,org.eclipse.ditto.two

If filtering by namespaces is not sufficient, Ditto also allows to provide an [RQL expression](basic-rql.html)
specifying:

* an [enriched](basic-enrichment.html) Thing state based condition determining when messages should be delivered and when not
* a filter based on the fields of the [Ditto Protocol](protocol-specification.html) message which should be filtered,
e.g.:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ or subscriptions for live messages, the following placeholders are available in
| `topic:subject` | Ditto Protocol [topic subject](protocol-specification-topic.html#messages-criterion-actions) (for message commands) |
| `topic:action-subject` | either Ditto Protocol [topic action](protocol-specification-topic.html#action-optional) or [topic subject](protocol-specification-topic.html#messages-criterion-actions) (for message commands) |
| `resource:type` | the type of the Ditto Protocol [path](protocol-specification.html#path) , one of: `"thing" "policy" "message" "connection"` |
| `resource:path` | the affected resource's path being the Ditto Protocol [path](protocol-specification.html#path) in JsonPointer notation, e.g. `"/"` when a complete thing was created/modified/deleted |
| `resource:path` | the affected resource's path being the Ditto Protocol [path](protocol-specification.html#path) in JsonPointer notation, e.g. `/` when a complete thing was created/modified/deleted |

### Scope: Connections

Expand All @@ -73,8 +73,8 @@ In [connections](basic-connections.html), the following placeholders are availab
| `{%raw%}{{ topic:action }}{%endraw%}` | Ditto Protocol [topic action](protocol-specification-topic.html#action-optional) |
| `{%raw%}{{ topic:subject }}{%endraw%}` | Ditto Protocol [topic subject](protocol-specification-topic.html#messages-criterion-actions) (for message commands) |
| `{%raw%}{{ topic:action-subject }}{%endraw%}` | either Ditto Protocol [topic action](protocol-specification-topic.html#action-optional) or [topic subject](protocol-specification-topic.html#messages-criterion-actions) (for message commands) |
| `{%raw%}{{ resource:type }}{%endraw%}` | the type of the Ditto Protocol [path](protocol-specification.html#path) , one of: `"thing" "policy" "message" "connection"` |
| `{%raw%}{{ resource:path }}{%endraw%}` | the affected resource's path being the Ditto Protocol [path](protocol-specification.html#path) in JsonPointer notation, e.g. `"/"` when a complete thing was created/modified/deleted |
| `{%raw%}{{ resource:type }}{%endraw%}` | the type of the Ditto Protocol [path](protocol-specification.html#path) , one of: `thing`, `policy`, `message` or `connection` |
| `{%raw%}{{ resource:path }}{%endraw%}` | the affected resource's path being the Ditto Protocol [path](protocol-specification.html#path) in JsonPointer notation, e.g. `/` when a complete thing was created/modified/deleted |


#### Examples
Expand Down
3 changes: 3 additions & 0 deletions documentation/src/main/resources/pages/ditto/basic-rql.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ an attribute with the name `location` as query property.

To filter nested properties, Ditto uses the JSON Pointer notation ([RFC-6901](https://tools.ietf.org/html/rfc6901)),
where the property can also start with a slash `/` or omit it, so those 2 query properties are semantically the same:

* `/attributes/location`
* `attributes/location`

Expand All @@ -65,6 +66,7 @@ When using an RQL expression in order to e.g. filter for certain
field in JSON representation inside the Thing.

Currently supported placeholders for RQL expressions are:
*
* `topic:<placeholder-name>`
* `resource:<placeholder-name>`

Expand Down Expand Up @@ -198,6 +200,7 @@ like(<property>,<value>)

The `like` operator provides some regular expression capabilities for pattern matching Strings.
The following expressions are supported:

* \*endswith => match at the end of a specific String.
* startswith\* => match at the beginning of a specific String.
* \*contains\* => match if contains a specific String.
Expand Down

0 comments on commit 014d129

Please sign in to comment.