Skip to content
Snippets Groups Projects

DOC: Nested queries

Merged Daniel Hornung requested to merge f-doc-subqueries into dev
1 unresolved thread
2 files
+ 15
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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
Please register or sign in to reply
* 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.`
Loading