sony / nmos-js

An NMOS (Networked Media Open Specifications) Client in Javascript (IS-04, IS-05)
Apache License 2.0
33 stars 18 forks source link

Fall back to core RQL operators or Basic Query Syntax when necessary #1

Closed garethsb closed 5 years ago

garethsb commented 6 years ago

The client now makes id queries using Basic Query Syntax and others using the Advanced RQL Syntax, of the form:

and(matches(<property>,string:<escaped-value>,i),...)

That works well to provide partial string matching with nmos-cpp-registry, but the support for RQL in other registry implementations (e.g. the BBC Joint RI) doesn't seem to be there and even if it is, the matches operator is currently unique to the nmos-cpp implementation. There is current work to more clearly define a useful core set of RQL operators for NMOS.

The NMOS spec says that implementations should respond with a HTTP 501 error if they don't support RQL or an RQL operator used in the query (although the BBC Joint RI doesn't do that yet).

Therefore it would be nice if the client were modified to try the current syntax, fall back to simple eq or contains RQL operators, and if that still results in a 501, try Basic Query Syntax. (Or as a first step, this could be controlled in the client-side settings.)

Thanks to Uvjal Lodha, AJA Video Systems, for reporting this issue.

garethsb commented 5 years ago

This is resolved in the new react-admin-based client (now on master branch) in almost all cases, by use of the "RQL" toggle switch in Settings. The remaining case that @aaronpereira-sony is looking at is implementing GET_MANY for ReferenceArrayField (used only for a few NMOS Resource properties such as Device senders, receivers and Source/Flow parents) when RQL is disabled.

garethsb commented 5 years ago

Final part resolved by 5424729043658698049402fbc902c434344981aa. Thanks, @rufusu-sony. (It could be optimized a small amount as comment indicates, but good enough since this operation is always going to be inefficient with a Query API that doesn't implement RQL.)