diff --git a/CHANGELOG.md b/CHANGELOG.md index d8101a5439db6c78dcdeed2a93b7735bac324c65..8942e49f07388e22cf4c729b580b930a8748c689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Documentation ### +- Nested queries. + ## [0.9.0] - 2023-01-19 ### Added diff --git a/src/doc/CaosDB-Query-Language.md b/src/doc/CaosDB-Query-Language.md index 0e05a56b259cb7f99cba7ad4d1dd6d1856117050..182e0767b78a6467585af5c9f8b4c4ac1f869fe6 100644 --- a/src/doc/CaosDB-Query-Language.md +++ b/src/doc/CaosDB-Query-Language.md @@ -310,6 +310,13 @@ One may omit the property specification: * `FIND ename1 WITH @ ename2` * `FIND ename1 . @ ename2` +### Nested queries, or filtering by sub-properties ### + +Nested queries can easily be searched by simply concatenating `WHICH` or `WITH` expressions: + +* `FIND ename WHICH HAS A pname WHICH HAS A subpname=val` +* For example: `FIND AN experiment WHICH HAS A camera WHICH HAS A 'serial number'= 1234567890` + ### Combining Filters with Propositional Logic Any result set can be filtered by logically combining POV filters or back reference filters: @@ -391,14 +398,13 @@ Since Caosdb 0.2 entities are optionally version controlled. The query language * The `ANY VERSION OF` modifier currently the only expression for taking the versioning into account when using the query language. * Subproperties are not supported yet, e.g. `FIND ANY VERSION OF ENTITY WHICH IS REFERENCED BY ename WITH ...`. This applies to all cases where you specify properties of *referenced* entities or *referencing* entities. -### Future - -* Add `(LATEST|LAST|OLDEST|NEWEST|FIRST) VERSION OF` modifiers. -* Add `(ANY|LATEST|LAST|OLDEST|NEWEST|FIRST) VERSION (BEFORE|AFTER) (<timestamp>|<transaction id>|<entity@version>) OF` modifier. -* Add support for subproperties, e.g. `FIND ANY VERSION OF ENTITY WHICH IS REFERENCED BY ename WITH ...`. - ## Future - * *Sub Queries* (or *Sub Properties*): `FIND ename WHICH HAS A pname WHICH HAS A subpname=val`. This is like: `FIND AN experiment WHICH HAS A camera WHICH HAS A 'serial number'= 1234567890` +* Additional versioning queries: + * Add `(LATEST|LAST|OLDEST|NEWEST|FIRST) VERSION OF` modifiers. + * Add `(ANY|LATEST|LAST|OLDEST|NEWEST|FIRST) VERSION (BEFORE|AFTER) (<timestamp>|<transaction + id>|<entity@version>) OF` modifier. + * Add support for subproperties, e.g. `FIND ANY VERSION OF ENTITY WHICH IS REFERENCED BY ename + WITH ...`. * *More Logic*, especially `ANY`, `ALL`, `NONE`, and `SUCH THAT` key words (and equivalents) for logical quantisation: `FIND ename1 SUCH THAT ALL ename2 WHICH HAVE A REFERENCE TO ename1 HAVE A pname=val`. This is like `FIND experiment SUCH THAT ALL person WHICH ARE REFERENCED BY THIS experiment AS conductor HAVE AN 'academic title'=professor.`