-
Notifications
You must be signed in to change notification settings - Fork 178
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
Replacement of #
separator for fragments in the Selector
#53
Comments
For coherency with the zenoh API where the Selector is the only parameter used in a The only parts from the URL that are sent by a web client to the server are the scheme, the authority, the path and the query. As the URL's path correspond to the Selector's path expression, only the query can be used for the projection. And we need to distinguish it from the filter and properties parts. Considering the RFC-3986 section on URI reserved characters:
"The purpose of reserved characters is to provide a set of delimiting characters that are distinguishable from other data within a URI." Proposals distinguish the projection part within the query part:
|
@kydos, @OlivierHecart , @Mallets |
My vote goes for [ ] as well:) |
+1 |
+1 for [ ] |
Rational
We need to replace the usage of
#
as separator for fragments in Selector because most of the web client won't send the fragment part of the URL to the zenoh HTTP plugin.Detail
The current (in 0.5.0-beta.5) specification of a zenoh Selector is the following:
where:
/demo/example/**
)'&'
allowing to perform filtering on the valuesassociated with the matching keys. Each predicate has the form "
field
-operator
-value
" value where:<
,>
,<=
,>=
,=
,!=
This feature only applies to structured values using a “self-describing” encoding, such as JSON or XML.
It allows to select only some fields within the structure. A new structure with only the selected fields
will be used in place of the original value.
For instance, if we imagine GPS coordinates of objects stored zenoh's time-series storages, under an undetermined hierarchy prefixed by
/demo/example/
, this Selector:/demo/examples/**/GPS-coordinate?lat>0(starttime=now()-1h)#lat;long;name
will retrieve all the GPS data of objects in the north hemisphere (lat>0) within the last hour (starttime=now()-1h) and for each data only the latitude, the longitude and the name should be returned.
A Selector can easily be used to get path/values from zenoh via the HTTP plugin, simply prepending the selector with the base URL of a zenoh router. E.g.:
http://localhost:8000/demo/examples/**/GPS-coordinate?lat>0(starttime=now()-1h)#lat;long;name
However, the majority of HTTP clients (web browsers, curl...) never send the fragment part of the URL (starting from
#
) to the web server (the zenoh HTTP plugin in our case). As a consequence, a web client won't be able to request only sub-parts of data.The text was updated successfully, but these errors were encountered: