Skip to content
Snippets Groups Projects
Verified Commit 1fedfb7b authored by Timm Fitschen's avatar Timm Fitschen
Browse files

DOC: update query tutorial

parent 89baf6a7
No related branches found
No related tags found
2 merge requests!103Quick main-release of documentation,!85DOC: F find query
Pipeline #30789 passed
......@@ -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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment