diff --git a/src/doc/extension/forms.rst b/src/doc/extension/forms.rst index e1891b8d7e571c4a273cec98fcc39e50398936f0..11a7167d1277c9fbb7ed6dda6e611ce4aca48302 100644 --- a/src/doc/extension/forms.rst +++ b/src/doc/extension/forms.rst @@ -22,7 +22,7 @@ The following code snippet adds a form to the body of the HTML document. const config = { name: "my_form", fields: [ - { type: "reference_drop_down", name: "experiment_id", label: "Experiment", query: "FIND Record Experiment", required: true }, + { type: "reference_drop_down", name: "experiment_id", label: "Experiment", query: "FIND Experiment", required: true }, { type: "integer", name: "number", label: "A Number", required: true }, { type: "date", name: "date", label: "A Date", required: false }, { type: "text", name: "comment", label: "A Comment", required: false }, @@ -85,7 +85,7 @@ If you intend to call a server-side script, the config has to be changed a litte const config = { script: "process.py", fields: [ - { type: "reference_drop_down", name: "experiment_id", label: "Experiment", query: "FIND Record Experiment", required: true }, + { type: "reference_drop_down", name: "experiment_id", label: "Experiment", query: "FIND Experiment", required: true }, { type: "integer", name: "number", label: "A Number", required: true }, { type: "date", name: "date", label: "A Date", required: false }, { type: "text", name: "comment", label: "A Comment", required: false }, diff --git a/src/doc/extension/query_templates.rst b/src/doc/extension/query_templates.rst index 4e511ac9f91b26ffcda2674362b00070948c1bd2..8c331386468c4392e6f2afa7d02264fb5cc1eadb 100644 --- a/src/doc/extension/query_templates.rst +++ b/src/doc/extension/query_templates.rst @@ -1,3 +1,7 @@ +=============== +Query shortcuts +=============== + Introduction ============ @@ -7,11 +11,10 @@ data as query strings which are used frequently. They can be stored and reused. .. figure:: images/shortcut_toolbox.png - :alt: The Shortcuts in the Query Panel; Note the Toolbox for in the - top right + :alt: Shortcuts in the query panel. There is a + toolbox for editing shortcuts in the top right. - The Shortcuts in the Query Panel; Note the Toolbox for in the top - right + Shortcuts in the query panel. Note the toolbox for editing shortcuts in the top right There are two ways to integrate query templates into the WebUI: @@ -47,7 +50,7 @@ It now opens a form with two input fields, ``Description`` and The view to create a new shortcut -See `2.4 <#basic-shortcut>`__ and `2.5 <#advanced-shortcut>`__ for +See `Basic Shortcut`_ and `Advanced Shortcut`_ for further explanation of the components of a Query Shortcut. Edit the fields and click ``Submit`` for the creation of the new @@ -177,6 +180,10 @@ Each placeholder *id* must occur only once in both components – if you need to use two years in your shortcut you have to use ``{year1}`` and ``{year2}`` or any other combinations of placeholder *ids*. + +Global Shortcuts +================ + Example for global_query_shortcuts.json --------------------------------------- @@ -191,7 +198,7 @@ The following example for the file global_query_shortcuts.json would create two }, { "description": "Show a table of Experiments for year: {year}", - "query": "SELECT date, project, identifier FROM Record Experiment with date in {year}" + "query": "SELECT date, project, identifier FROM Experiment with date in {year}" } ] diff --git a/src/doc/tutorials/query.rst b/src/doc/tutorials/query.rst index 29d998cc1dbce5c5e17ae4cf9f60176b9f88861a..bd57093869bdb8ecb52e7fe93d6ac5a3f6d03328 100644 --- a/src/doc/tutorials/query.rst +++ b/src/doc/tutorials/query.rst @@ -14,31 +14,31 @@ the webinterface under the respective menu entry. Let's start with a simple one:: - FIND RECORD MusicalInstrument + FIND MusicalInstrument Most queries simply start with the ``FIND`` keyword and describe what we are -looking for behind that. The ``RECORD`` keyword denotes that we are only looking -for Records (and not Files, Properties or RecordTypes). Finally, we provided -a RecordType name: MusicalInstrument. This means that we will get all Records -that have this RecordType as parent. Try it out! +looking for behind that. Then, we provided a RecordType name: +MusicalInstrument. This means that we will get all Records that have this +RecordType as parent. Try it out! Let's look at:: - FIND Guitar + FIND ENTITY Guitar -When we leave out the ``RECORD`` keyword, we will get every entity that is a -Guitar. When you submit this query you should find also a RecordType Guitar -in the results. Using ``FIND RecordType Guitar`` would restrict the result to -only that RecordType. +When we add the ``ENTITY`` keyword we will get every entity that is a +Guitar -- also the RecordType, and even a Property with that name if there +exists one. Using ``FIND RecordType Guitar`` would restrict the result to +only that RecordType. And ``FIND RECORD MusicalInstrument`` is just equivalent +to ``FIND MusicalInstrument``. -Note, that you cannot only provide RecordType names after the ``FIND``, but names -in general: ``FIND RECORD Nice Guitar``. This will give you a Record with the +Note, that you can provide not only RecordType names after the ``FIND``, but names +in general: ``FIND "Nice Guitar"``. This will give you a Record with the name "Nice Guitar" (if one exists... and there should be one in the demo instance). While it does not matter whether you use capital letters or not, the names have to be exact. There are two features that make it easy to use names for querying in spite of this: -- You can use "*" to match any string. E.g. ``FIND RECORD Nice*`` +- You can use "*" to match any string. E.g. ``FIND Nice*`` - After typing three letters, names that start with those three are suggested by the auto completion. @@ -64,7 +64,9 @@ result set. In general this looks like:: FIND <Name> <Property Filter> Typically, the filter has the form ``<Property> <Operator> <Value>``, -for example ``length >= 0.7mm``. +for example ``length >= 0.7mm``. Instead of the ``<Name>`` you can also use one +of the entity roles, namely ``RECORD``, ``RECORDTYPE``, ``FILE``, ``PROPERY``, +or ``ENTITY``. There are many filters available. You can check the specification for a comprehensive description of those. Here, we will only look at the most common examples. @@ -72,7 +74,7 @@ those. Here, we will only look at the most common examples. If you only want to assure that Records have a certain Property, without imposing constrains on the value, you can use:: - FIND RECORD MusicalInstrument WITH Manufacturer + FIND MusicalInstrument WITH Manufacturer Similarly, to what we saw above when using incomplete names, you can use a "*" @@ -138,6 +140,6 @@ information in a table. A comma separated list of Property names can be provided Or:: - SELECT quality_factor, report, date FROM Analysis WHICH REFERENCES A Guitar WITH electric=TRUE + SELECT quality_factor, report, date FROM Analysis WHICH REFERENCES A Guitar WITH electric=TRUE