Tags: user, how-to

How to search data in LinkAhead#

How to find your data?#

To find specific data sets in LinkAhead, open the query panel by clicking on the query item in the top menu bar. Here you can enter search commands, or queries, using the LinkAhead query language (LQL).

A query always begins with a keyword. There are three keywords you can choose from:

  • FIND displays entities that match specific criteria

  • COUNT returns the number of records that meet certain conditions

  • SELECT specifies which fields or columns to include in the output

For more information, have a look at

Search by RecordType#

To get all Record entries of a specific RecordType, search with FIND {name of RecordType}. For example, to find all stored Sample records, write in the query field:

FIND Sample

If you are interested only in the number of records, use COUNT instead of FIND:

COUNT Sample

Search for data schema components#

If you are not interested in records, but instead want information about the data schema, try searching for RecordTypes instead of records (the default):

FIND RECORDTYPE Machine

This returns the Machine RecordType and all RecordTypes which inherit from it.

RecordTypes can also be found by their Properties:

FIND RECORDTYPE WITH latitude

Similarly, you can also search for Property entries:

FIND PROPERTY production_date

Search by text#

Sometimes you want to search for a specific text. In this case, you can shorten the search input. Simply put the text you are looking for in the query field:

Nice

This will return all records which

  • have Nice in their name,

  • have Nice in one of their Property values,

  • or reference another Record which has Nice in its name.

Search for Record with a Property#

You can find records that have a {property regardless of whether the value for the property is set or not.

To retrieve any records with Parent “Manufacturer” which have a Property “address”:

FIND Manufacturer WITH "address"

It does not matter what the address looks like, LinkAhead returns all manufactures which have any address.

This also works for linked properties:

FIND Manufacturer WITH Contact WITH email_address

Filter the search results by property value#

If you want to search for Records with a certain property that has a certain value (for example a price of at least 100), the general structure of the query is FIND {RecordType name} WITH {Property name} = {value}.

To find all bicycle frames with a weight of 10kg, type:

FIND Frame WITH weight = 10 kg

You can also omit the unit (weight = 10) and might then also get miniature frames whose weight is stored as 10g.

You can also use the other operators which are listed in the reference, like !=, <=, <, >=, and >.

Filter with wildcards#

Wherever you can filter by text, you can instead also filter by text chunks. This works by replacing the = by LIKE and adding wildcard asterisks * to the text chunk:

FIND MusicalInstrument WITH Manufacturer LIKE Gi*

and

FIND MusicalInstrument WITH Manufacturer LIKE *bson

will both show instruments by the manufacturer Gibson.

Search by date and time#

LinkAhead generally uses the YYYY-MM-DDT00:00:00 datetime format (ISO 8601). When searching for dates and times, you can use the following DateTime operators: =,!=, <, >, IN, and NOT IN.

Search for an exact date:

FIND Record WITH production_date = 2020-12-02

If you want to search for all machines produced in a specific year, modify the query like this:

FIND Machine WITH production_date IN 2020

Organize simple data in tables#

To organize data in tables, use the SELECT query. Use it like this:

SELECT {property 1}, {property 2}, [...] FROM {same as FIND query}

For example, to get all production dates and manufacturers of machines after 2010, write:

SELECT production_date, Manufacturer FROM Machine WITH production_date > 2010

Get data from the network of records, as a table#

When specifying SELECT queries, you can also display linked records’ properties, by concatenating property names with a .:

SELECT production_date, Manufacturer.latitude, Manufacturer.longitude, Manufacturer.Contact.email_address
  FROM Machine

Reuse search queries#

Reusing search queries is covered in a different user guide: How-to: Query shortcuts