Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
cea7829f
Commit
cea7829f
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'f-find-query' into 'dev'
DOC: F find query See merge request
!85
parents
106e617c
b43ac004
No related branches found
No related tags found
2 merge requests
!103
Quick main-release of documentation
,
!85
DOC: F find query
Pipeline
#35077
passed
2 years ago
Stage: setup
Stage: linting
Stage: test
Changes
3
Pipelines
16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/doc/extension/forms.rst
+2
-2
2 additions, 2 deletions
src/doc/extension/forms.rst
src/doc/extension/query_templates.rst
+13
-6
13 additions, 6 deletions
src/doc/extension/query_templates.rst
src/doc/tutorials/query.rst
+18
-16
18 additions, 16 deletions
src/doc/tutorials/query.rst
with
33 additions
and
24 deletions
src/doc/extension/forms.rst
+
2
−
2
View file @
cea7829f
...
...
@@ -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 },
...
...
This diff is collapsed.
Click to expand it.
src/doc/extension/query_templates.rst
+
13
−
6
View file @
cea7829f
===============
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
Q
uery
P
anel
; Note the Toolbox for in the
top right
:alt: Shortcuts in the
q
uery
p
anel
. 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 <#b
asic
-s
hortcut
>`_
_ and `
2.5 <#a
dvanced
-s
hortcut
>`_
_ for
See `
B
asic
S
hortcut
`
_ and `
A
dvanced
S
hortcut
`
_ 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}"
}
]
...
...
This diff is collapsed.
Click to expand it.
src/doc/tutorials/query.rst
+
18
−
16
View file @
cea7829f
...
...
@@ -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 can
not 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment